Here is my implementation (which, I think, is more true for the SO style than the accepted answer). The style may need to be customized, but it is functionally the same as you see on SO.
Features:
It accepts a predefined input field with words separated by commas - ideal for all cases, such as those in which you are editing an element that already has tags, and creates an interactive tag editor from this information.
example in rails format:
<input id="post_tag_list" name="post[tag_list]" value='testing, test, probably, goose, under_score'/>
Updates the hidden input field when the user edits tags so that all the necessary tags are in the submitted form.
Deleting back through the input field of tags (false) functionally coincides with deleting one long line of words, making editing more natural.
To edit, click on the tags.
Commas, spaces, returns, and tabs close the open tag that is being edited or created.
The close button on tags functions as expected.
and etc.
Find it here: http://jsfiddle.net/bradleygriffith/axjKm/
source share