Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

setting 'inputMaxLength' #347

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/jquery.tagsinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
interactive:true,
defaultText:'add a tag',
minChars:0,
inputMaxLength:null,
width:'300px',
height:'100px',
autocomplete: {selectFirst: false },
Expand Down Expand Up @@ -220,7 +221,11 @@
var markup = '<div id="'+id+'_tagsinput" class="tagsinput"><div id="'+id+'_addTag">';

if (settings.interactive) {
markup = markup + '<input id="'+id+'_tag" value="" data-default="'+settings.defaultText+'" />';
var extraAttributes = '';
if (settings.inputMaxLength !== null) {
extraAttributes += ' maxlength="'+settings.inputMaxLength+'" ';
}
markup = markup + '<input id="'+id+'_tag" value="" '+extraAttributes+' data-default="'+settings.defaultText+'" />';
}

markup = markup + '</div><div class="tags_clear"></div></div>';
Expand Down