Reputation: 1
Normally, tags value of TextExt jquery plugin is selected tags value when we press entry key; However, when loaded page, I have one $_GET['name']="jam"
so I would to set auto tags selection of this value. How to do that intextExt plugin?
I would like to attach simple script as follows:
$('#textarea')
.textext({
plugins : 'tags autocomplete'
})
.bind('getSuggestions', function(e, data)
{
var list = ['David','Nary','Jam'],
textext = $(e.target).textext()[0],
query = (data ? data.query : '') || '';
$(this).trigger(
'setSuggestions',
{ result : textext.itemManager().filter(list, query) });
});
How to select auto tags selection of $_GET['name']
?
Upvotes: 0
Views: 696
Reputation: 1
As shown on the example on http://textextjs.com/manual/examples/tags-with-items.html
<script type="text/javascript">
$('#textarea').textext({
plugins: 'tags',
tagsItems: [ 'PHP', 'Closure', 'Java' ]
});
</script>
"tagsItems" is where you set your default values.
Upvotes: 0