Jaime Hablutzel Jaime Hablutzel -4 years ago 121
jQuery Question

how to check if a form is valid programmatically using jQuery Validation Plugin

I have a form with a couple of buttons and I´m using jQuery Validation Plugin from http://jquery.bassistance.de/validate/, and I just want to know if there is a way I can check if the form is considered in valid state by jquery validation plugin from anywhere in my javascript code.

Answer Source

Use .valid():

$("#form_id").valid();

Checks whether the selected form is valid or whether all selected elements are valid. validate() needs to be called on the form before checking it using this method.

Where the form with id='form_id' is a form that has already had .validate() called on it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download