sliptree / bootstrap-tokenfield

A jQuery tag/token input plugin for Twitter's Bootstrap, by the guys from Sliptree
http://sliptree.github.io/bootstrap-tokenfield/
Other
861 stars 238 forks source link

Prevent duplicate entries and prevent new entries #317

Open gitcostan opened 6 years ago

gitcostan commented 6 years ago

Hello

I read the example mentioned at - https://github.com/sliptree/bootstrap-tokenfield#and-how-about-limiting-tokens-to-my-typeaheadautocomplete-data

But I was not able to prevent.

Pls suggest where these code snippets must be used in the context of the full example. I am trying use this in jQuery autocomplete (not the Twitter one)

Many thanks.

l1th1um commented 6 years ago

+1 for this matter

hitched97 commented 6 years ago

Does this help? Typing violet and hitting enter will add the token, typing orange and hitting enter will not.

https://jsfiddle.net/esbfp8q1/