I could not find a solution that perfectly matched my requirements, so I got the following:
I am using the jQuery keypress() event to verify that the user clicks the @ symbol.
If so, a modal dialog is displayed using the jQuery UI. This dialog box contains an autocomplete text box (you can use many options here, but I recommend jQuery Tokeninput )
When the user selects an option in the dialog box, the tag is added to the text box and the dialog closes.
This is not the most elegant solution, but it works, and it does not require additional keystrokes compared to my original design.
Edit
Thus, we have a large text field in which the user can enter text. It should be able to "tag" the user (this simply means inserting #<userid> into the text). I join the jQuery keyup event and detect the @ character using (e.which == 64) to show a modal text field for selecting user tags.
The softness of the solution is just a modal dialog with the jQuery Tokeninput text box. As the user enters here, the user list is loaded via AJAX. For proper use, see Examples on the website. When the user closes the dialog, I paste the selected identifiers into a large text box.
Martin Wiboe Jun 08 '11 at 19:59 2011-06-08 19:59
source share