Is there a way to show custom HTML5 form validation errors on load form?
Asked
Active
Viewed 1,638 times
1
-
Please clarify: do you want to show custom error messages, or the HTML5 error messages? – robertc Jan 25 '13 at 16:47
-
This might help you: http://stackoverflow.com/questions/10361460/how-can-i-change-html-5-form-validation-errors-default-messages – Tjoene Jan 25 '13 at 16:48
1 Answers
1
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/

makque
- 191
- 2
- 5
-
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 Jan 25 '13 at 21:16
-