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

Markus Ernst derernst at gmx.ch
Thu May 6 08:10:27 PDT 2010

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">

More information about the whatwg mailing list