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

[whatwg] Keywords for the pattern attribute [was: RFC: <input type="username">]

From: Markus Ernst <derernst@gmx.ch>
Date: Thu, 06 May 2010 17:10:27 +0200
Message-ID: <4BE2DBE3.7090106@gmx.ch>
Am 06.05.2010 15:18 schrieb Smylers:
> Schalk Neethling writes:
> 
>> if your username field will be in the form of an email address, then
>> simply use type=username with a pattern to facilitate email
>> validation.
> 
> Surely a major reason for having standard validation types is so web
> developers don't need to come up with patterns for these common things?

Maybe it is a problem to have several functionalities mixed up in the 
type attribute, such as control display, autofill and validation 
functionalities. OTOH there are validation hints both in the type and 
pattern attributes.

Maybe keywords could be added as possible values of the pattern 
attribute, in order to provide standard validation types such as e-mail, 
numeric, or maybe also date and datetime.

<input type="text" pattern="email">
<input type="username" pattern="email">
Received on Thursday, 6 May 2010 08:10:27 UTC

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