Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I suppress UA validation of HTML5 "email" fields?

When using HTML5 "email" fields —  <input type="email"/> — a lot of UAs (user agents/browsers) prevent you from submitting the form without using a "valid" (by regex) email address. They also apply the :invalid pseudoclass. However this my conflict with your own validation scheme, and the lack of direct feedback may confusing visitors. Also, :invalid is applied (in Chrome 8) to my field before anyone even attempts to submit it. I hate this. I t makes it look like the user has made a mistake, but they haven’t yet.

So is it possible to use <input type="email"/> without triggering validation behavior?

like image 426
Alan H. Avatar asked Dec 31 '10 18:12

Alan H.


1 Answers

According to Philip Taylor (Philip) on the irc.w3.org#html-wg IRC room:

http://whatwg.org/html5#attr-fs-novalidate says you can use to disable validation for the whole form

So basically, you can apply novalidate as an attribute on the entire form. You can also specify a submit button to submit the form without validating — the canonical example is a “save progress” button that doesn’t validate at all. In that case, you put formnovalidate on the submit button itself.

like image 187
Alan H. Avatar answered Nov 05 '22 21:11

Alan H.