方案一:重写验证方法,在方法里提示不同的验证消息
$.extend($.fn.validatebox.defaults.rules, {
???? checkDrawMoney:{
????? validator:function(value,param){
?????? var rules = $.fn.validatebox.defaults.rules;
????????????? if (!value){??
????????????? ?return false;
????????????? }
????????????? value = com.utils.Utils.parseMoney(value);
?????value = parseFloat(value);
?????var balVal = parseFloat(com.utils.Utils.parseMoney($("#"+param).val()));
?????if (value>balVal || value ==0) {
??????rules.checkDrawMoney.message = "金额必须大于0且不能大于存款余额!";
??????return false;
?????}
?????if(balVal-value<10000){
??????rules.checkDrawMoney.message = "最低留存金额不能小于10000!";
??????return false;
?????}
????????????? return true;
????????? },??
???????? message:''
???? }
???});
?
?
方案二:
自从1.3.2版本开始,validatebox自身已经支持多重校验了
|