Skip to content

FRM-007 Give fields for the person's own details the matching autocomplete value

Level
Rule
Verdict
Requirement
Area
Forms
Status
decided, version 1.0.4

Rule

When a field asks for the person's own details and WCAG 2.2 lists a matching input purpose, give the field the exact autocomplete value for that purpose and never remove it. Our own addition, which 1.3.5 does not ask for: never stop the browser or a password manager from filling the field in.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: The exact value for each field

autocomplete="given-name"

autocomplete="family-name"

autocomplete="email"

autocomplete="postal-code"

autocomplete="address-level2"

autocomplete="country-name"

Each field tells the browser exactly what it holds. If your browser has your address saved, click in First name: it can offer to fill in all six fields at once, each with the right part.

Don't: Off, missing or made up

autocomplete="name"

autocomplete="off"

no autocomplete, only type="email"

autocomplete="zip"

autocomplete="off"

autocomplete="off"

First name claims the whole name, zip is not a value HTML knows, and the rest are turned off or missing. Browsers, password managers and tools that help people fill in forms get a wrong purpose or none.

Why

Typing a name, an address or a card number again and again is slow for everyone and hard for people with motor, memory or reading difficulties. When each field says in code what it holds, the browser and the password manager can offer the right stored value, and other tools can add a familiar icon or word to the field. WCAG 2.2, 1.3.5 Identify Input Purpose requires that purpose to be exposed for fields about the person filling in the form, when the purpose is in the list of input purposes (see Understanding 1.3.5). What counts is the value in the code, not whether a given browser fills the field. On sign-in, a form that lets the password manager do its job also supports WCAG 2.2, 3.3.8 Accessible Authentication (Minimum), and a correct accessible name under WCAG 2.2, 4.1.2 Name, Role, Value helps the password manager find the fields. Not blocking filling on other fields is our own choice, so that the value in the code is never wasted.

Do

  • Split name fields get one value each: First name gets given-name and Last name gets family-name. A single field for the whole name gets name.
  • Email gets email and Mobile number gets tel. If the phone number is split into a country code and a number, the parts get tel-country-code and tel-national.
  • A delivery address split into fields gets address-line1 for Street address, address-line2 for Flat number or c/o, postal-code for Postcode and address-level2 for City. A single address box, a <textarea>, gets street-address.
  • A select for Country gets country-name when its options are country names, or country when the values are country codes. The rule covers selects and text areas, not only text inputs.
  • Date of birth as one field gets bday. As three fields for day, month and year, they get bday-day, bday-month and bday-year.
  • On sign-in, Username gets username and Password gets current-password. On sign-up and when the password is changed, the new password field gets new-password, so the password manager can suggest and save a strong one.
  • A field that accepts either a user name or an email address may carry either username or email.
  • Card fields get cc-name for Name on card, cc-number for Card number, cc-exp for a single expiry field, or cc-exp-month and cc-exp-year for two, and cc-csc for CVC.
  • A field for a one-time code from an SMS gets one-time-code. That value is not in WCAG's list, so this is good practice, not part of the requirement.
  • If a field uses a type with built-in browser checks, such as the type="email" that the guideline FRM-014 asks for, turn off the browser's own validation on the form with novalidate and show errors as FRM-002a, FRM-002b and FRM-011 describe. Otherwise the browser can stop at the first bad field and show its own short-lived bubble.
  • Keep the visible label as well. The autocomplete value tells the browser what the field holds; it never replaces the label that FRM-001 asks for.

Don't

  • Put autocomplete="off" on First name, Postcode or Card number. On a field in scope it removes the purpose.
  • Give First name the value name, which means the whole name. A value that is close but wrong is still wrong.
  • Make up values such as autocomplete="firstname" or autocomplete="zip". Only the values HTML defines are understood.
  • Rely on type="email" or type="tel" alone (the type picks the keyboard, FRM-014). The type says what kind of value it is, not whose value or which part, so it does not expose the purpose.
  • Block paste in Password, or run a script that clears or rejects values the browser or the password manager has filled in.
  • Give fields about someone else the person's own values. Recipient's name on a gift order with name invites the browser to fill in the buyer's name.

Exceptions

  • Fields about someone other than the person filling in the form, such as a gift recipient, a child or an emergency contact, are outside this rule. Leave them without the person's own values. If a delivery address may belong to someone else, the shipping section word keeps it apart from the person's own address.
  • A field whose purpose is not in WCAG's list needs no value. A National ID number is one example, and so are a search field and a free-text message.
  • An amount to pay or transfer is about the transaction, not the person, so it needs no value even though HTML has one for it.
  • Paste is a different route from filling. At sign-in it is FRM-008; elsewhere it is the guideline FRM-017.

Verdict

Requirement. Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on FRM-007
SourceRoleStancePage
WCAG 2.2LawRequires1.3.5 Identify Input Purpose
WCAG 2.2LawSupports3.3.8 Accessible Authentication (Minimum)
WCAG 2.2LawSupports4.1.2 Name, Role, Value
Material DesignJudge No position
Apple Human Interface GuidelinesJudge SupportsVirtual keyboards (ios, ipados, tvos, visionos, watchos; no web guidance)
Entering data
Managing accounts
Carbon Design SystemJudge SupportsForms
GOV.UK Design SystemExpert witness SupportsText input
Email addresses
Addresses
Nielsen Norman GroupExpert witness No position

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.4, : Refers to FRM-014 for the input type and to FRM-008 and FRM-017 for paste.
  • Version 1.0.3, : Refers to FRM-011 instead of ACT-004 for a form sent with problems.
  • Version 1.0.2, : The rule sentence marks not blocking filling as our own addition to 1.3.5.
  • Version 1.0.1, : Examples in English.
  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Forms: 15 rules and 12 guidelines · All rules