【发布时间】:2009-10-26 20:00:11
【问题描述】:
我使用 jQuery 验证插件的方式与 Remember The Milk demo 非常相似。
$("#registrationForm").validate({
rules: {
email: {
required: true,
email: true,
remote: '<%=Url.Action(...) %>'
},
},
messages: {
email: {
required: "Please enter an email address",
email: "Please enter a valid email address",
remote: jQuery.format("{0} is already in use")
}
});
第一次提交无效电子邮件(例如 bob@mail.com)时,错误消息与预期一致。但是,如果我随后输入另一个无效的电子邮件(例如 sue@mail.com),验证插件仍会显示“bob@mail.com 已在使用中”。
我已经跟踪到达Url.Action 调用中指定的控制器的参数,它们绝对是正确的(即“sue@mail.com”作为电子邮件地址发送,而这是在字段中输入的) .
有没有其他人在使用 jQuery 验证插件时遇到过这个或类似的问题?
【问题讨论】:
标签: jquery asp.net-mvc jquery-validate