• 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