Identifying Input Purpose
Autocomplete tokens, and deciding whose information a field holds
When a form field asks for the person's own details, the field must say what it is asking for in a way a browser can read. That is what the autocomplete attribute does. With it, a browser or assistive tool fills the field in automatically. Without it, every person who fills in the form types their own name, address and phone number by hand, every time.
This is a Level AA requirement, and it is the one requirement no automated checker has ever reported. Published tools only check whether an attribute that is already there carries a valid value. A field with no attribute at all falls outside what they look at, which is why sites reported as clean on this criterion often are not.
What to avoid
<input type="text" name="name" id="name">
<input type="email" name="email" id="email" autocomplete="on">
<input type="tel" name="phone" id="phone" autocomplete="off">
- None of the three fields declares a purpose. The first has no attribute at all.
onandoffare browser toggles, not purposes. They say whether the browser should try, not what the field holds.autocomplete="on"is the default on every new element in Drupal Webform, so it is what you find when you open the panel. It looks like the helpful choice, writes nothing into the page, and satisfies nothing.
Best practice
<input type="text" name="name" id="name" autocomplete="name">
<input type="email" name="email" id="email" autocomplete="email">
<input type="tel" name="phone" id="phone" autocomplete="tel">
Each field names the specific thing it collects, so a browser can fill all three in one action rather than leaving the person to type them.
Whose information is it?
This is the part that matters most, and the part no checklist can decide for you.
The criterion applies only to fields collecting information about the person filling in the form. Putting a purpose token on a field that asks for somebody else's details is its own failure, listed in WCAG as F107, because the browser will helpfully autofill the wrong person's information into it.
Library forms are full of these:
- An emergency contact's phone number on a home delivery form
- The name of an ancestor on a genealogy research request
- A nominee on an award form
- The address of the venue where an event will be held
- A parent or guardian on a youth program registration
Every one of those looks identical in the markup to the patron's own equivalent field. A "City" box on an event location block and a "City" box on the patron's own address block are the same box. The difference is only in what the form is asking.
If the browser fills this in with my own details, is that right? If the answer is no, leave the field alone. Leaving a field alone is always safe. Guessing is not.
Fields made of several boxes
Some form builders group related boxes into a single element. A "Basic address" element in Drupal Webform renders as six separate inputs sharing one name, like address[address], address[city] and address[postal_code].
These need particular attention, because the element editor offers no Autocomplete dropdown for them at all. There is no setting to miss, which means they are almost never set. They are fixed in the element's Custom properties instead, one line per sub-field.
Common tokens
| The field asks for | Token |
|---|---|
| Full name | name |
| First name | given-name |
| Middle name or initial | additional-name |
| Last name | family-name |
| Email address | email |
| Phone number | tel |
| Street address on one multiline box | street-address |
| Street address, first line | address-line1 |
| Apartment, suite or unit | address-line2 |
| City | address-level2 |
| State or province | address-level1 |
| ZIP or postal code | postal-code |
| Country | country-name |
| Organization | organization |
| Date of birth | bday |
A field that genuinely does two jobs, such as one box labeled "Phone/Email", cannot declare two purposes. Leaving that field alone is the defensible answer.
Why it matters
For someone with a tremor, a motor disability, or a memory-related disability, retyping the same personal details into every form is the difference between finishing it and abandoning it. Autofill is not a convenience for these users; it is what makes the form completable.
It also helps people with cognitive disabilities who find recalling and entering information difficult, and anyone using a screen reader or a switch device, where every keystroke costs more than it does with a keyboard and a mouse.