W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2010

[whatwg] RFC: <input type="username">

From: Mounir Lamouri <mounir.lamouri@gmail.com>
Date: Thu, 06 May 2010 12:12:55 +0200
Message-ID: <4BE29627.4000308@gmail.com>
On 05/06/2010 12:09 PM, Thomas Broyer wrote:
> On Thu, May 6, 2010 at 11:51 AM, Markus Ernst <derernst at gmx.ch> wrote:
>> Am 05.05.2010 23:06 schrieb Schalk Neethling:
>>>
>>> The way I see it is that instead of browsers traversing the DOM looking
>>> for
>>> an input field of either id=username or name=username or even
>>> class=username, they now only have to look for an input of type username.
>>> Makes it a lot easier for both developers and browser vendors as they now
>>> only have to look for an input of type username and gives developers the
>>> freedom to use any name, id or class.
>>
>> But in many cases the username is an e-mail address, then you get a conflict
>> with type="email".
> 
> type=email is expected to (depending on the browser) allow you to
> search into/autocomplete from your address book. I really don't see a
> conflict here, it's not about syntax, it's about "semantics"
> (otherwise, just use a pattern="" constraint).

The input type='email' isn't only about semantic. The browser has to
check if the email is valid according to HTML5 specifications. Please,
have a look at:
http://dev.w3.org/html5/spec/forms.html#valid-e-mail-address

If the entered email address is invalid, the element will suffer from a
type mismatch.

--
Mounir
Received on Thursday, 6 May 2010 03:12:55 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:23 UTC