[VE][html5] Email Input Attributes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[VE][html5] Email Input Attributes

Christopher Dickinson
I am using an email input field in my webpage; the code looks like:

<input type="email" id="email" name="email" size="80" maxlength="80" value="" required="required" />

When I run my page through the W3 HTML5 Validator, I get the following two errors:
  • Attribute maxlength is only allowed when the input type is e-mail, password, search, tel, text, or url.
  • Attribute required is only allowed when the input type is checkbox, date, datetime, datetime-local, e-mail, file, month, number, password, radio, search, tel, text, time, url, or week.

It's an email input type, but the validator seems to reject it; the warnings don't seem to make sense.

Reply | Threaded
Open this post in threaded view
|

Re: [VE][html5] Email Input Attributes

Michael[tm] Smith
Christopher Dickinson <[hidden email]>, 2015-03-28 10:55 -0400:

> Archived-At: <http://www.w3.org/mid/CALafDytF-KYykj=5LD+ozHCVvixYBxL=ZFnJfQiJkbE6Pf9z4Q@...>
>
> I am using an email input field in my webpage; the code looks like:
>
> <input type="email" id="email" name="email" size="80" maxlength="80" value=""
> required="required" />
>
> When I run my page through the W3 HTML5 Validator, I get the following two
> errors:
>
>    - Attribute maxlength is only allowed when the input type is e-mail,
>    password, search, tel, text, or url.
>    - Attribute required is only allowed when the input type is checkbox,
>    date, datetime, datetime-local, e-mail, file, month, number, password,
>    radio, search, tel, text, time, url, or week.
>
> It's an email input type, but the validator seems to reject it; the
> warnings don't seem to make sense.
Sorry about that. The cause was a change I made very recently that
introduced a regression. But I’ve fixed it now.

  —Mike

--
Michael[tm] Smith https://people.w3.org/mike

signature.asc (836 bytes) Download Attachment