How can I write a form that assists my browser's auto-complete feature?

845 Views Asked by At

How does Chrome, or other browsers, determine what data is appropriate to auto-complete into a particular form field? Is it just based on the name and type? Are there other semantic / microdata standards I should be aware of that can give it a hint?

I seem to recall reading a standard of form field hints for chrome, but I can't find that article anymore.

2

There are 2 best solutions below

0
On

Microformats!

http://microformats.org/

They are open data formats based upon already existing standards.

vCard, hCard, etc!

0
On

HTML5 defines:

When the autofill field name is "on", the user agent should attempt to use heuristics to determine the most appropriate values to offer the user, e.g. based on the element's name value, the position of the element in the document's DOM, what other fields exist in the form, and so forth.

Several autofill field names are defined, that can be used as values for the autocomplete attribute, for example:

  • name for the full name
  • nickname for the nickname, screen name, etc.
  • organization-title for the job title
  • bday for the birthday
  • tel for the telephone number

(FWIW, there is also RFC 3106 which defines values for e-commerce.)


Update (2015): These autofill field names did not make it to the HTML5 REC. However, they are again/still part of HTML 5.1 (WD), and currently also part of the Editor’s Draft.

Update (2016): It’s part of HTML 5.1 (REC): Autofill.