word limit with jquery

0

I'm using xoxco's jquery.tagsinput plugin to insert a tagged field into my article, but I need a tag limit inserted there, so I need a word counter to limit how many words are inserted, with the pluguin, whenever the user types "space" creates a tag

Does anyone know a script for this?

or another better plugin to create tags?

[edited]

function to count the tags typed with the jquery.tagsinput.js plugin

var tagcount = 0; $("#tags").tagsInput({ 'width':'100%', onAddTag: function(elem, elem_tags){ tagcount += $(this).length; if(tagcount > 10){ $(this).removeTag(elem); } }, onRemoveTag: function(){ tagcount -= $(this).length; } });

Thank you guys

    
asked by anonymous 05.03.2017 / 00:45

0 answers