我使用的jQuery驗證插件的方式與Remember The Milk demo非常相似。爲什麼使用jQuery(遠程)驗證時,錯誤消息中顯示錯誤的字段值?
$("#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")
}
});
第一次提交無效的電子郵件(例如[email protected])時,錯誤消息如預期。但是,如果我輸入另一個無效電子郵件(例如[email protected]),則驗證插件仍會顯示「[email protected]已被使用」。
我跟蹤了到達Url.Action
調用中指定的控制器的參數,它們絕對正確(即,當在該字段中輸入「[email protected]」作爲電子郵件地址發送時)。
有沒有其他人遇到這個或類似的問題,使用jQuery驗證插件?
哦..感謝我不確定我可以使用哪些項目來測試,以使錯誤與他們發生。 – Jedidja 2009-10-26 20:40:26