Any suggestions? Yes. Don't.
<input type="email" />
Problem solved!
It should be noted that use of HTML5 features will make for a beautiful web... provided the browser supports it. The reason being, a failed validation will cause the browser to notify the user of the error in a non-intrusive and consistent, native manner.
Older browsers will not be able to validate in this way, however due to the specification stating that unrecognised type
values should default to text
, HTML5 is fully backwards compatible, way back into IE5.5 and almost certainly even earlier - maybe even IE1!
This lack of validation is not an issue. Validation should always be handled server-side, regardless of what validation you have on the client-side. As an example, in PHP, you would pass it through filter_var
with the FILTER_VALIDATE_EMAIL
filter.