jQuery Validation Plugin - Enable 'Eager' Validation only after and Invalid Submit

Posted by Ryan Fitzer on Stack Overflow See other posts from Stack Overflow or by Ryan Fitzer
Published on 2010-05-13T01:12:52Z Indexed on 2010/05/13 1:14 UTC
Read the original article Hit count: 316

Filed under:
|

By default, if a user enters a value in a field, the 'eager' validation kicks in. Is there any way to disable 'eager' validation before submit and then enable it after an invalid submit has happened?

I've used $.validator.setDefaults() to initially set the onkeyup and onfocusout properties to false.

In the invalidHandler method I rerun the $.validator.setDefaults(), setting onkeyup and onfocusout properties to true.

No luck with this approach.

Basically, I only want the 'eager' validation to take place after the user tries to submit an invalid form.

Thanks for any help.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about form-validation