Now when validation fail I don't get the message define in addMethod (i.e. "Must contain only letters, numbers, or dashes.") intsead it give message inside title of that field (i.e. "Transaction Name")推荐答案解决了从addMethod()本身中删除错误消息. 将邮件放入为Removing error message from the addMethod() itself.Putting the message as $("myForm").validate({ 规则:{ trans_name:{ transactionRegex:true } }, 消息:{ trans_name:{ transactionRegex:只能包含字母,数字或破折号." //注意:错误消息必须用双引号引起来. } } }); $("myForm").validate({ rules: { trans_name: { transactionRegex:true } }, messsage: { trans_name: { transactionRegex:"Must contain only letters, numbers, or dashes." //Note: Error message must be in double quote. } } }); 这篇关于jQuery验证插件的addMethod()从title属性显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-24 00:56