我在我的MVC网站上使用jQuery-validation来检查反馈表单,我写了这段代码
$(function () {
$("#feedback-form").validate({
submitHandler: function (form) {
form.submit();
},
rules: {
Name: {
required: true,
minlength: 2
},
Email: {
required: true,
email: true
},
Phone: {
required: true,
number: true
},
Company: {
required: true
},
ProjectInformation: {
extension: "doc|docx|txt|pdf"
}
},
messages: {
Name: {
required: "@Resources.Global.Feedback_Error_Name_Empty",
minlength: "@Resources.Global.Feedback_Error_Name_Short"
},
Email: {
required: "@Resources.Global.Feedback_Error_Email_Empty",
email: "@Resources.Global.Feedback_Error_Email_Valid"
},
Phone: {
required: "@Resources.Global.Feedback_Error_Phone_Empty",
number: "@Resources.Global.Feedback_Error_Phone_Valid"
},
Company: {
required: "@Resources.Global.Feedback_Error_Company_Empty"
}
}
});
});
但是当我尝试发送例如空表单时,我没有收到任何错误消息 我在控制台中收到错误
Uncaught TypeError: Cannot call method 'call' of undefined
我使用jquery-2.0.3.min.js
和jQuery Validation Plugin - v1.11.1
怎么了?如何解决?