Rule

Autocomplete tokens

autocomplete attributes must use valid tokens.

Rule
autocomplete-valid
WCAG 2.2
1.3.5 Identify Input Purpose (opens in a new tab) (Level AA)
Severity
Serious

What it checks

The autocomplete attribute tells browsers and assistive tools what a field asks for, such as email, given-name or postal-code. The rule fails a value with a token that is not in the HTML list, and a value whose known tokens are in an order HTML does not allow, such as two field names or shipping with no field name. A browser that cannot read a value ignores all of it, so no purpose is exposed.

The rule assumes the field collects information about the person filling it in, which is what the attribute is for. Checkboxes, radio buttons, file inputs, buttons and disabled fields are not checked.

When a person decides

A search box with an invalid value is sent for review rather than failed, since a search usually collects nothing about the user.

Example

Fails

<label for="email">Email</label>
<input type="email" id="email" autocomplete="e-mail">

Passes

<label for="email">Email</label>
<input type="email" id="email" autocomplete="email">

The engine is tested against both examples.

How to fix it

Use a token from the HTML autofill list, such as autocomplete="email". Combine tokens only in the order HTML gives, such as autocomplete="shipping postal-code".

Check your own pages

This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.