I'm trying to validate a input
of type file
with Jquery Validation.
Following the documentation, I do the following: My input:
<input class="form-control" id="ImagemUpload" name="ImagemUpload" type="file" value="">
and my script:
$("#ImagemUpload").rules("add", {
accept: "image/jpeg, image/pjpeg",
messages: {
accept: "Formato inválido."
}
});
However, you are not validating and the following message is appearing in the console:
Uncaught TypeError: Can not read property 'call' of undefined