呼如林
简单实现代码如下:$("#rewardForm").validate({rules: {"reward": {required: true,digits:true,balance:true,checkBalance:true}}, messages:{"reward":{digits:" * 请填写正确的转账金额(应为数字)",required:" * 请输入转账金额 "}}});jQuery.validator.addMethod("balance", function(value,element) {var sumreward=$("#sumreward").val();return this.optional(element) || value<= sumreward;}, $.validator.format(" * 余额不足 "));jQuery.validator.addMethod("checkBalance", function(value,element) {var balance=0;return this.optional(element) || value>balance;}, $.validator.format(" * 转账金额必须大于0 "));