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
Don't: Off, missing or made up
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-nameand Last name getsfamily-name. A single field for the whole name getsname. - Email gets
emailand Mobile number getstel. If the phone number is split into a country code and a number, the parts gettel-country-codeandtel-national. - A delivery address split into fields gets
address-line1for Street address,address-line2for Flat number or c/o,postal-codefor Postcode andaddress-level2for City. A single address box, a<textarea>, getsstreet-address. - A select for Country gets
country-namewhen its options are country names, orcountrywhen 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 getbday-day,bday-monthandbday-year. - On sign-in, Username gets
usernameand Password getscurrent-password. On sign-up and when the password is changed, the new password field getsnew-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
usernameoremail. - Card fields get
cc-namefor Name on card,cc-numberfor Card number,cc-expfor a single expiry field, orcc-exp-monthandcc-exp-yearfor two, andcc-cscfor 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 withnovalidateand 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
autocompletevalue 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"orautocomplete="zip". Only the values HTML defines are understood. - Rely on
type="email"ortype="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
nameinvites 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
shippingsection 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
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Requires | 1.3.5 Identify Input Purpose |
| WCAG 2.2 | Law | Supports | 3.3.8 Accessible Authentication (Minimum) |
| WCAG 2.2 | Law | Supports | 4.1.2 Name, Role, Value |
| Material Design | Judge | No position | |
| Apple Human Interface Guidelines | Judge | Supports | Virtual keyboards (ios, ipados, tvos, visionos, watchos; no web guidance) Entering data Managing accounts |
| Carbon Design System | Judge | Supports | Forms |
| GOV.UK Design System | Expert witness | Supports | Text input Email addresses Addresses |
| Nielsen Norman Group | Expert 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
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.