Formating form error in HTML5? [closed]
开发者_JAVA百科
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this questionHey, I have a form like this:
http://jsfiddle.net/Myxqk/
Try to type something what is not an vaild e-mail address such as "4asd".
See what happens.
Is there a way to format/change this error look?
For example I don't want it all, just want the input border to pulse. Or become red.
Thanks a lot.
Have you seen this example for email field:
http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_form_email
The email validation here is not being handled by html5 but by the server.
Are you using PHP or some other framework?
The best solution in my case was:
Adding "novalidate" to my form tag (so I can still stick to "email" input).
Using jQuery to validate (animate()).
Thanks a lot guys! As I thought in the beginning there is no way of really getting into HTML5 core functions like this one. Sad, but hope they'll fix it. If not it's going to be useless where design counts!
#input {border-color: red;}
?
HTML5 is not widely adopted, so you should not rely on browser behaviour for a spec that isn't even finalized.
Therefore, just have custom JS/CSS which does what you want.
精彩评论