Using 'ignore' in jQuery validate stopping submit
Hi - here is my validation code:
$('.myForm').validate({
ignore: [],
rules: {
overallRating: { required:true },
wouldRecommend: { required:true }
},
submitHandler: function(form, event)
{
event.preventDefault();
var formValues = getFormValues();
submitForm(formValues);
}
});
Pretty striaghtforward. But - the ignore: [] line stops the form from submitting. So - the submitHandler never gets hit.
I need the ignore: [] line in there as I'm validating some hidden fields. I know these fields are being validated and also pass validation as the error message is removed - so, the form should submit.
If I remove the ignore: [] the form submits fine but I need that line in order to validate hidden fields.
Any ideas?
Thanks