jquery validation plugin - different treatment for display errors vs. clearing errors
Posted
by RyOnLife
on Stack Overflow
See other posts from Stack Overflow
or by RyOnLife
Published on 2010-03-25T17:18:51Z
Indexed on
2010/06/07
7:52 UTC
Read the original article
Hit count: 216
I am using the popular jQuery Validation Plugin. It's very flexible with regards to when validations are run (onsubmit, onfocusout, onkeyup, etc.).
When validations do run, as appropriate, errors are both displayed and cleared.
Without hacking the plugin core, I'd like a way to split the behavior so:
- Errors are only displayed onsubmit
- But if the user subsequently enters a valid response, errors are cleared onsubmit, onfocusout, etc.
Just trying to create a better user experience: Only yell at them when they submit, yet still get the errors out of their face as soon as possible.
When I ran through the options, I didn't see the callbacks necessary to accomplish this. I'd like to make it work without having to hack the plugin core.
Anyone have some insights? Thanks.
© Stack Overflow or respective owner