@@ -238,6 +238,7 @@ $(function(){
|
||||
width:$(tagsInputSettings).find(".form-control").width(),
|
||||
defaultText:'please input keywords',
|
||||
'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词
|
||||
maxCount:4,
|
||||
onAddTag:function(tag,size){
|
||||
//var keywordValue = "";
|
||||
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var kaiOptions = new Array();
|
||||
var delimiter = new Array();
|
||||
var tags_callbacks = new Array();
|
||||
$.fn.doAutosize = function(o){
|
||||
@@ -82,6 +82,11 @@
|
||||
tagslist = new Array();
|
||||
}
|
||||
|
||||
var maxCount=kaiOptions[id]['maxCount'];
|
||||
if(maxCount>0 && tagslist.length>maxCount-1){
|
||||
$('#'+id+'_tag').addClass('not_valid');
|
||||
return ;
|
||||
}
|
||||
value = jQuery.trim(value);
|
||||
|
||||
if (options.unique) {
|
||||
@@ -190,6 +195,7 @@
|
||||
placeholderColor:'#666666',
|
||||
autosize: true,
|
||||
comfortZone: 20,
|
||||
maxCount:0,
|
||||
inputPadding: 6*2
|
||||
},options);
|
||||
|
||||
@@ -210,6 +216,8 @@
|
||||
fake_input: '#'+id+'_tag'
|
||||
},settings);
|
||||
|
||||
kaiOptions[id] = new Array();
|
||||
kaiOptions[id]['maxCount']=settings.maxCount;
|
||||
delimiter[id] = data.delimiter;
|
||||
|
||||
if (settings.onAddTag || settings.onRemoveTag || settings.onChange) {
|
||||
|
||||
Reference in New Issue
Block a user