Is there a way to show custom HTML5 form validation errors on load form?
-
Please clarify: do you want to show custom error messages, or the HTML5 error messages?robertc– robertc2013-01-25 16:47:43 +00:00Commented Jan 25, 2013 at 16:47
-
This might help you: stackoverflow.com/questions/10361460/…Tjoene– Tjoene2013-01-25 16:48:16 +00:00Commented Jan 25, 2013 at 16:48
Add a comment
|
1 Answer
check this one out: http://www.w3.org/html/wg/drafts/html/master/forms.html#dom-cva-setcustomvalidity
object.setCustomValidity(error)
sample: http://jsfiddle.net/makque/DQvsH/
I have issues with the type="email" myself, since it still accepts input like you@mail as a valid email address, thanks for the question.
[edited] I don't get it, but like this? http://jsfiddle.net/makque/wk4HY/
2 Comments
dani herrera
Mark, welcome to SO! This is that I need but ... is there a way to autoexecute
previewMessage() on form load. I mean show messages at same time that form is loaded ( without click preview errors ).dani herrera
Thanks, sorry about delay.