Posted 2007-05-12T22:55:00+01:00 in web usability

Common names for input fields in web forms

I'm working on some HTML web forms for a new website at work. I had to choose names for the fields. I figured that if I choose the same name for the field as other sites do, than the user's web browser will probably be able to AutoComplete data as the user types the first letters in the form field, like:

City: N...
City: Ne..
City: New.
City: New York
Ingredient: C...
Ingredient: Cu...
Ingredient: Cucumber

So, that set me of on a quick tour on the web in search of form fields for a name, emailaddress, city, and postal code. Low and behold, I haven't come across any consistent naming for these fields. Am I the only person seeing the value of AutoComplete across sites? Well, hardly: There are many sites using the letter q for free text searches in the site, in analogy with Google. But for the other fields, like city and postal code, I haven't found any reference material indicating a preference for a word, like 'city' for the locality (VCard definition) where someone might live.

Web Forms 2.0

Ian Hickson and comrades have defined the autocomplete attribute on input elements. It's defined as:

The on value means the UA may store the value entered by the user so that if the user returns to the page, the UA can prefill the form. The off value means that the UA must not remember that field's value.

As specified in the Web Forms 2.0 proposal from 2005.

That indicates that some thought has been given to the autocomplete feature on webpages, but no mention of coherent naming across sites to ease the process of filling out forms.

VCard and X.520

Some slightly related specifications might help me out, like the VCard standard. The VCard spec defines a set of names that are very similar to the ones I regularly use in websites, here's a selection:

surname
Family name, e.g. 'Pulles'
givenName
first name, e.g. 'Jeroen'
streetAddress
...
houseIdentifier
e.g. a house number
postalCode
...
localityName
A very politically correct synonym for city, village, town or municipality or a myriad of words for the same thing in other languages...
countryName
( ISO 3166 codes only, specifies x520)

Suggested form input field names

Let's lay claim to some input names:

email-address
An e-mail address identifies a location to which e-mail can be delivered.
given-name
A given name specifies and differentiates between members of a group of individuals, especially a family, all of whose members usually share the same family name.
house-identifier
e.g. a house number
locality
The term locality has different meanings in different disciplines: In geography, a locality is a place. This is the primary meaning of the term, from which other uses derive.
postal-code
A postal code is a series of letters and/or digits appended to a postal address for the purpose of sorting mail.
q
Free text search where there is no known context of what the user might be looking for.
rq
Here's a funny one we decided on for a recipe site where we explicitly didn't want to have any nonsense you type in Google, when searching for recipes or ingredients. A clear example that it might be beneficial to constrain the possible input to a certain domain (or thesaurus).
street-address
The first line of the street address, route number, or other specific identifier for the physical location of the site or incident.
surname
A family name, or surname, is that part of a person's name that indicates to what family he or she belongs.

Example

A simple form would look like this:


<form>
  <fieldset>
    First name    <input type="text" name="given-name" />
    Last name     <input type="text" name="surname" />
    Email address <input type="text" name="email-address" />
    <button type="submit">OK</button>
  </fieldset>
</form>

So, I've got a starting point. Trivial, but really useful. Let me know if you find this a useful idea too.