I use https://github.com/aehlke/tag-it this add-on for autocomplete tags
User can simply take tags from an existing array of sampleTags
Before adding a tag, I check if the element is in the array or not
beforeTagAdded: function(evt, ui) { var counter = jQuery.inArray(ui.tagLabel, sampleTags); if (counter != -1 ) { return true; } else { alert('This word is not in array'); return false; } },
But the input is not deleted.
How can i do this?
jsFiddle: http://jsfiddle.net/zqDXL/3/
source share