EasyUI Forum
July 27, 2024, 02:20:03 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: validType:'length[0,10]' is invalid for tagbox?  (Read 3028 times)
kingor2001
Jr. Member
**
Posts: 61


View Profile
« on: June 21, 2019, 11:03:27 AM »

validType:'length[0,10]' is invalid for tagbox?
such as <input class="easyui-tagbox" data-options="label:'foo',validType:'length[1,2]'">, the length[1,2] is invalid.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2269


View Profile Email
« Reply #1 on: June 22, 2019, 06:50:22 AM »

You should custom a validation rule for the tagbox.
Code:
$.extend($.fn.validatebox.defaults.rules, {
taglength: {
validator: function(value,param){
value = $.trim(value).replace(/\,$/,'');
var len = $.trim(value).split(',').length;
return len >= param[0] && len <= param[1]
},
message: 'Please enter a value between {0} and {1}.'
}
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!