I’m using this plugin:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
For JQuery form validation. Everything is working great except for the email field. As soon as I start typing in that field, the “Please enter a valid email address.” message appears, even though what I’ve typed so far is correct.
In the documentation (http://docs.jquery.com/Plugins/Validation) it says:
“Before a field is marked as invalid, the validation is lazy: Before
submitting the form for the first time, the user can tab through
fields without getting annoying messages – he won’t get bugged before
he had the chance to actually enter a correct value”
But this doesn’t seem to happen for the email field.
This problem can also be seen in the author’s demo:
http://jquery.bassistance.de/validate/demo/
Is there an option/workaround for this behaviour?
It’s not just with the
emailrule. You can see the same behavior on theminlengthrule.http://jsfiddle.net/f3sxF/
You could use the pre-release version which seems to fix this. However, rather than risking new bugs by the use of a “pre-release” version of the plugin on your production site, you could simply use a modified version of the
onkeyupcallback function…Using the above, all
onkeyupvalidation is ignored until the form is submitted for the first time, or until the user tabs out of a field which contains entered data.Demo: http://jsfiddle.net/wNj4n/