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