I'm making a form that takes e-mail addresses and am deciding whether to use input type='email'
or input type='text'
and do the validation using JavaScript. I know determining whether an e-mail addresses is of a valid format or not is a difficult task so does anyone know how good a job HTML 5's email attribute does of it?
Reasons to use email attribute
Reasons not to use email attribute
EDIT: Anyone know how e-mail
attribute works in the sense what regular expression it uses?
Facts about HTML5's <input type="email">
:
*@*
as a valid email address. In Safari, Chrome and Firefox you need to enter at least *@*.*
My suggestions is you should start using this new HTML5 attribute along with your own validation to achieve point (3) above.
For more info :
Hopefully this help.