laktek / jQuery-Smart-Auto-Complete

AutoComplete plugin with smart defaults and flexibility to customize
http://laktek.com/2011/03/03/introducing-jquery-smart-autocomplete/
248 stars 34 forks source link

Selected items appear again in comma separated list autocomplete #13

Open mayankk4 opened 12 years ago

mayankk4 commented 12 years ago

In a comma separated list, with auto-completion, after I have already selected an option it shows up again in autocomplete.

eg. If I have already chosen United States as one of my Favourite countries then it should not show up again in autocomplete but it does appear again.

laktek commented 12 years ago

You can keep the potential results in an array and remove the item which was selected in the itemSelect event handler. Then use the filter function of the plugin to look for matches in that array (Check the examples 5 & 6 in demo for the use of filter function and itemSelect event).