例:$.extend($.fn.validatebox.defaults.rules, {
number: {
validator: function(value){
return /^-?(?:/d+|/d{1,3}(?:,/d{3})+)(?:/./d+)?$/.test(value);
},
message: '只能输入数字.'
}
});
//验证输入最短长度
$.extend($.fn.validatebox.defaults.rules, {
minLength: {
validator: function(value, param){
return value.length >= param[0];
},
message: ‘Please enter at least {0} characters.’
}
});