http://docs.jquery.com/Plugins/Validation”rel=“noreferer”j Query Validate,用大量重复的数据浏览对网页进行验证。 由于空间有限,每一行都有自己的鉴定摘要。
我用添加《物证规则》对页数适用审定规则,但缺省错误信息在摘要中过于笼统(例如,“需要现场,需要现场等)。
例:
jQuery.validator.addClassRules({
amount: {
required: true,
range: [0, 2000000]
},
comment: {
maxlength: 51
},
owner: {
notFirstOption: true
},
A: {
required: function (element) {
return getParentElement($(element), "tr").find(".colB input.B").val().length > 0;
},
digits: true
}});
您能否对每一验证类别的规则适用习惯信息? 理想的情况是:
jQuery.validator.addClassMessages({
amount: {
required: "Amount is required",
range: "Amount must be between 0 and 2,000,000"
},
comment: {
maxlength: "Comment may be a maximum of 51 characters"
},
owner: {
notFirstOption: "Please select an owner"
},
A: {
required: "A is required if B is entered",
digits: "A must be numeric"
}});
事先感谢你们能够提供的任何帮助。