I have a form with some required fields. If the user clicks a button, validation should fire, and their input will be processed. However, after processing, I want to reset/clear the form and allow them to enter more information. After I call form.reset() and validator.resetForm() though, the validation messages are shown because the form has been cleared. What is the proper way to clear the form and ensure that no validation messages appear? Here's the complete fiddle illustrating the issue. Here's the code snippet that I'd like to get working:
$('#btnGo').click(function(){
// clear the form
$('#frmFoo')[0].reset();
// AFTER this call to resetForm, validation message is shown again. Why?
validator.resetForm();
});
Thanks,
Andy