Rampsight

All rules

Forms

autocomplete must use the standard tokens

Why it matters

Correct autocomplete values let a browser fill a form from stored data and let assistive technology explain each field in familiar terms. An invented value turns both off.

How to fix it

  1. Use the tokens from the HTML specification: email, given-name, postal-code, cc-number, and so on.
  2. Combine section and billing/shipping prefixes for repeated address blocks.
  3. Use autocomplete="off" only where the field genuinely must not be remembered.

In markup

Fails
<input type="email" autocomplete="yes">
Passes
<input type="email" autocomplete="email">

The requirement behind it

This rule is one way of failing the following WCAG 2.2 success criteria. The W3C, which writes the standard, explains each of them:

Further reading

Deque University on autocomplete-valid (opens in new tab)

Deque maintains axe-core, the open-source engine our scanner runs. Their page documents the rule as the engine implements it.

Automated checks find failures a browser can prove. They cannot judge whether a caption is accurate, whether an alt text is useful, or whether a page can be operated end to end with a keyboard — those need a person.