【发布时间】:2014-03-31 10:16:20
【问题描述】:
我在我的表单上使用以下验证,因为我有一个 email address 字段和 confirm email address 字段我需要一些验证以确保这两个字段匹配,我目前有以下内容,这给了我错误消息即使匹配也不匹配,有人知道为什么会这样吗?
rules: {
'entry[email]': {
required: true,
email: true
},
'entry[confirm_email]': {
// required: true,
equalTo: "entry[email]"
},
},
messages: {
'entry[email]': {
required: ' Please enter a valid email address',
minlength: 'Not a valid email address'
},
'entry[confirm_email]': {
required: ' Please make sure email matches above',
minlength: 'Does not match above email address'
},
}
【问题讨论】:
-
即使我的电子邮件匹配正确,它也会告诉我它们不匹配
-
请创建一个 jsfiddle。
-
“entry[email]”是输入元素的id吗??
-
对不起,伙计们,我的输入元素的 ID 不同,现在可以使用了!谢谢:)
-
你为什么不跟进first version of your question?切勿重复发布!