Problem: HTML validator: value of attribute “type” cannot be “email”

Problem: The HTML validator gives this error: value of attribute “type” cannot be “email”

This is because input type email isn’t in HTML4 specification. It’s a specification from HTML5, but the validator work’s on HTML4 standard and will show the error when validating forms with input type email.

Using input type=”email” for email addresses is better than using type=”text” because then users of (iPad/iPhone, Android) will have the correct keyboard come up for entering an email address. The keyboard will have the @ symbol and .com on it.

There will be no problems with any older browsers, they all treat type=”email” as type=”text” anyway.

So there is an advantage to using input type=”email” for email addresses, Mobile Accessibility. The only disadvantage is what the validator says. Because of the advantage of Mobile Accessibility, the validator can safely be ignored and users of smart phones will enjoy your site more.

In version 4.0 the setting was added to select field type: text or field type: email, if you select field type: text, then this validate error goes away. Field type: text will be the default for the email field in version 4.0+

See related:
Problem: Email field is styled differently than other fields

Do you need help?

Donations by PayPal:

If you find this free contact form program/plugin useful to you, please consider making a small donation to help contribute to further development. My time is very limited and I get dozens of support emails every day. If you are not able to donate, that is OK. Thanks for your kind support! - Mike Challis

Donations by cash or check:
Mike Challis
PO Box 819
Long Beach WA 98631

Comments are closed.