Im currently trying to use a jQuery plugin: jQuery Autocomplete Tokenizer Now after posting back the page, I want to re-load the values back into the textbox for whatever items had been entered.
Now the jQuery on the page is like below:
$(document).ready(function () {
$("#<%=txtPeople.ClientID %>").tokenInput("Handler.ashx", {
hintText: "Type in a name",
noResultsText: "No results",
searchingText: "Searching...",
prePopulateFromInput: true
},
prePopulate: **Here is where I want to add JSON listing the items that should be populated**
});
});
If I add the JSON below within the prepopulate it loads the values the first time the form loads (And after any postbacks, so I need a way to make this a variable, that I can feed into the javascript on the page, and also have it updated by any client side changes)
[{"id":1,"name":"Ben"},{"id":2,"name":"Bernard"},{"id":3,"name":"Joe Bentley"}]
Can anyone point me in the right direction or give any references that may help? thanks