Hello, I'm using the following JQUERY Autocomplete plug-in: jQuery Plugin: Tokenizing Autocomplete Text Entry
What'd I'm unable to figure out is how to add a value to the list from outside of the autocomplete dropdown list.
The reason I want to do this is the autocomplete searches for locations, if a location is not found, there is an "ADD" modal dialog where users can add a location. After they add/submit the location I would like that new value to be automatically added to the autocomplete input.
Here is the JS I'm trying to get to submit the new value to the autocomplete input:
$.TokenList.submitLocation.add_token_values("99", "Alpha");
Here's the JS that initiates the Autocomplete input:
$(function(){
$("#locationlist").tokenInput("/locations/autosuggest/", {
hintText: "Type the location name",
noResultsText: "No results",
searchingText: "Searching...",
callback: submit locationList
})
});
** I've found in jquery.tokeninput.js, the function add_token (item), but haven't been able to call it successfully.
Ideas?