- Success Criterion 1.3.5
- Conformance level AA
- W3C reference F107
Autocomplete Attribute Set to the Wrong Value for the Field
1.3.5 — Identify Input Purpose
Scenario
Setting
A nonprofit's donation form
What’s wrong
The autocomplete attribute has an invalid or wrong value (e.g., 'given-name' on a surname field) — browsers and tools can't identify or autofill the field.
Example
<label for="lname">Last Name</label>
<input id="lname" name="lname" autocomplete="given-name"> Why it matters
A donor's browser autofills their first name into the last name field, and they must notice and manually correct it before their receipt prints the wrong name.
How to test
Inspect the field's autocomplete value in DevTools: it must exactly match a valid Input Purpose token for what it collects (e.g., "tel" for phone) — a mismatched token fails.
How to fix
Match the autocomplete token to what the field actually collects, not just any token pulled from the list.
<label for="lname">Last Name</label>
<input id="lname" name="lname" autocomplete="family-name"> Outcome
A donor's browser now correctly fills in their last name, matching what the field actually asks for.
Who is affected
Users of browser and password-manager autofill, and people with cognitive disabilities who rely on it to avoid form errors, get the wrong data inserted.
Learn more
- Understanding Understanding document (opens in a new tab)
- Technique Related technique (opens in a new tab)
Related scenarios
- Personal-Data Field With No Autocomplete Attribute at All
- Autocomplete Deliberately Disabled on a Personal-Data Field
- Autocomplete Token Placed on the Wrong HTML Element
- Custom Form Widget That Drops the Native Autocomplete Behavior
- Autocomplete Section Token Used Incorrectly, Breaking Its Value
- Login or Checkout Iframe That Strips Out Autocomplete Support