/* * 对easyui-validatebox的验证类型的扩展,值必须在某个区间 */ $.extend($.fn.validatebox.defaults.rules, { valueBettween: { validator: function(value, param){ return value >= param[0] && value <= param[1] }, message: "u5fc5u987bu5728{0}-{1}u533au95f4" } });
用法:data-options="validType:'valueBettween[0,50]'"