Using the showErrors() function of JQuery validation, I am manually adding errors to my form:
var errors = {};
errors['Field1'] = 'Field1 has an error';
errors['Field2'] = 'Field2 has an error';
errors['Field3'] = 'Field3 has an error';
$('form').validate().showErrors(errors);
Why can't I then remove these using $('form').validate().resetForm();
? The only way of doing this seems to be to reset all the indexes to null:
var errors = {};
errors['Field1'] = null;
errors['Field2'] = null;
errors['Field3'] = null;
$('form').validate().showErrors(errors);