Reputation: 4073
I have integrated this for auto complete with tags input. The script I am using is below
$('#textarea').textext({
plugins : 'tags focus autocomplete ajax',
tagsItems : [ 'Skoda, BMW, Audi' ],
ajax : {
url : '/manual/examples/data.json',
dataType : 'json',
cacheResults : true
}
});
Here the value 'Skoda, BMW, Audi'
is passed from PHP variable. On page load I can not show these values already selected in tags
format. How can I pass the value 'Skoda, BMW, Audi'
in below format
'Skoda', 'BMW', 'Audi'
so that it gets displayed in tagsItems
. Also when I search, it keeps on calling my ajax URL
in a loop and without any result.
Feel free to suggest any better plugin for autocomplete with tags input ?
Thanks.
Upvotes: 1
Views: 500
Reputation: 98
The problem in your case is that you are not getting a returned value-
the example one the site is not complete- the tags are stored in a .json file (here).
The url of this file is defined here-
url : '/manual/examples/data.json',
You should create your own file with the tags you would like to allow, and change the url accordingly.
Upvotes: 0