Populate JQuery TokenInput on AJAX event -


let jquery tokeninput attached text field pre populate parameter defined during initialization.

now want populate input field tokens on event trigger without re-initialization of plugin.

i have found solution of work. thats why posting here others can benefit answer.

let occupation field id "occupation".

$("#occupation").tokeninput("add", {id: 1, name: "software engineer"}); 

"add" function adds json record token on fly.

hope helps.

thanks


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -