jquery validate accept method - TypeError: Cannot read property 'call' of undefined
To use the "accept"
method you'll need to include the jQuery Validate additional methods file. Simply include it after your validate file:
<script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
Then try initiating your validator like this instead:
$(document).ready(function(){
$("#upload").validate({
...settings...
});
});
And remove the onClick
and type="button"
attribute from your button.
Here are the docs:
http://jqueryvalidation.org/validate/