Prevent adding token to jQuery-TokenInput -


i using jquery-tokeninput in application.i have list of items, when enter text if matched text in list should not added.

for example: if had list["abc","def","xyz"].

so if enter in "xyz" in jquery-tokeninput textbox, should not add.

thanks,
naresh.

i'd work onadd event, , use remove function call. try along these lines. (it need debugging, think principle should work.)

var list = ["abc","def","xyz"];  var newti = $("#myti").tokeninput("search.php", {    propertytosearch: "val",    onadd: function(item){       if ($.inarray(list,item.val)) selector.tokeninput("remove", item);    }, }); 

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -