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

Christoph Päper christoph.paeper at crissov.de
Wed May 5 13:09:52 PDT 2010


Eitan Adler:
> 
> A type="username" is added to the input element. type="username" would MUST only be used for the name that is used to log in to the site. It MUST NOT be used for registration forms or anything else that requires a username. A form MAY have up to one (but not more) type="username" input field.

I agree with whomever mentioned that 

  <form role=login>

seems more appropriate. Anyhow, I wondered whether it makes sense to apply microformats to such forms, perhaps reusing ‘hcard’:

  <form class=vcard role=login method=post action="./">
    <input type=text name=username class=nickname>
    <input type=password name=password>
    <input type=submit>
  </form>

Nick and user name are probably not the same all that often and differ by site, so this probably doesn’t make sense at all. Still, form field semantics (‘name’/‘id’ and ‘class’ or ‘role’) may improve through some kind of standardization, although names shouldn’t be as clumsy as in RFC 3106 (ECML: Field Specifications for E-Commerce) when applied to HTML forms.

  <form action="http://ecom.example.com" method=post class=Ecom> 
  <fieldset class=Payment-Card>
    <legend>Please enter card information</legend>
    <label class=Name>Your name on the card 
      <input type=text name="Ecom_Payment_Card_Name" size=40>
    </label>
    <label class=Number>The card number 
      <input type=text name="Ecom_Payment_Card_Number" size=19>
    </label>
    <label class=ExpDate>Expiration date (MM YY) 
      <input type=month class=Month name="Ecom_Payment_Card_ExpDate_Month" size=2> 
      <input type=year class=Year name="Ecom_Payment_Card_ExpDate_Year" size=4>
    </label>
    <input type=hidden class=Protocol name="Ecom_Payment_Card_Protocol">
  </fieldset>
  <input type=hidden class=SchemaVersion name="Ecom_SchemaVersion" value="http://www.ecml.org/version/1.1">
  <input type=submit> <input type=reset>
  </form>




More information about the whatwg mailing list