Any Idea Not To Select The Name That Is Already Chosen In Token Input?
Is there any idea not to select the name that is already chosen in token input? For example In first I select mango when I search for m. Next time again when I search for m Mango s
Solution 1:
When you initialize tokeninput in your JavaScript, you can add preventDuplicates: true
and this will prevent duplicates from being selected, but they'll still be shown in the results (demo).
So something like:
$(...).tokenInput("url", { preventDuplicates: true, otherOptionsHere });
If you don't want them shown at all, it would probably be possible to write some code for the onResult
callback that checks the value of the field and removes the ones that are already there.
edit: since you use CoffeeScript, try
$('#customer_plan_tokens').tokenInput'/plans.json'theme: 'facebook'prePopulate: $('#customer_plan_tokens').data('load')
preventDuplicates: true
Post a Comment for "Any Idea Not To Select The Name That Is Already Chosen In Token Input?"