I use JQuery Validation Plugin to validate my form and it works for all fields,
but when I try to use it for <input type="file" id="ProjectInformation">
<script>
$(function() {
$("#feedback-form").validate({
submitHandler: function(form) {
form.submit();
},
rules: {
Name: {
required: true,
minlength: 2
},
ProjectInformation: {
extension: "doc,txt,pdf",
}
},
messages: {
Name: {
required: "Please enter a name",
minlength: "Name must consist of at least 2 characters"
},
ProjectInformation: {
extension: "Only .doc, .txt, and .pdf files allowed",
}
}
});
});
</script>
I get error Uncaught TypeError: Cannot call method 'call' of undefined
What's wrong?