I have read about 10 questions that were suggested - but cant seem to find a similar issue:
The token input works fine when typing - however the prepoluated values only become "active" after I add a name - ie on page load they appear empty in the post data.
I have an ajax script that posts the data to a php page - and I can see the correct values being sent in the console - but on page load there is nothing when I send it.
<span class="font-heavy" id="">To:</span>
<input type="text" id="users" name="blah" placeholder="Add friends"/>
<input type="hidden" id="tags" />
<script type="text/javascript">
$(document).ready(function() {
$("#users").tokenInput([
'.@$loadjs.'
],{
prePopulate: [
'.@$prejs.'
/*{id: 123, name: "Pri User"},
{id: 555, name: "Bob Hoskins"}*/
],theme: "facebook",preventDuplicates: true, hintText: "Add Partners"
});
});
</script>
Does anyone know what I am missing / need to do?
I have looked around the js file and found the function add_token (item) but not sure what I have to do. The prePopulate names are there and displaying correctly, as I mentioned, they only seem to "activate" when I add another name...
I found a second instance of the token div in a modal window - after removing this it worked - sorry for any inconvenience. Took me 2 hours to figure out!