Mohan Ram
Mohan Ram

Reputation: 8463

How to disable the jquery.validate error indications

I had used Jquery validate plugin to check out error and i had submitted the thing via ajax. since i am using same form for two purpose. One for add form, and another for edit form.

Once user check on submit button on add form. some error would be display on screen. We he/she toggle to edit form. I need to wash out that error and use to jquery.validate as a fresh. Remember i am using single validation script for both add and edit form. Form is same but during submission different action occurs.

I need to wash out errors of jquery.validate while toggling add to edit screen or viceversa.

Thanks in advance...

Upvotes: 1

Views: 245

Answers (1)

codeandcloud
codeandcloud

Reputation: 55200

Try resetForm().

Resets the controlled form.

Resets input fields to their original value (requires form plugin), removes classes indicating invalid elements and hides error messages.

Usage

var validator = $(...).validate();
validator.resetForm();

Dependency: jQuery Form Plugin.

Upvotes: 1

Related Questions