my coding part
$("#demo-input").tokenInput("data/autosuggest-search-city.php",
{
searchDelay: 2000,
minChars: 3,
tokenLimit: 10
});
I want to send the selected values as extra parameter to "data/autosuggest-search-city.php".
For example, Initially I search and select one value from list then again searching, this time I want to send the 1st selected value to server.
How to do this?
TokenInput plugin doesn't support that natively.
You can however make a simple workaround to update "AJAX url" whenever a token is added or removed from selection.
Use
onAdd
andonDelete
callbacks to trigger "AJAX url" changes;Get selected tokens using
selector.tokenInput("get")
method;Set the new "AJAX url" by updating
.data("settings").url
of the element;