1

Is there a way to show custom HTML5 form validation errors on load form?

2
  • Please clarify: do you want to show custom error messages, or the HTML5 error messages? Commented Jan 25, 2013 at 16:47
  • This might help you: stackoverflow.com/questions/10361460/… Commented Jan 25, 2013 at 16:48

1 Answer 1

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/

Sign up to request clarification or add additional context in comments.

2 Comments

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 ).
Thanks, sorry about delay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.