Skip to main content

Cornell University

Web Accessibility Reviews

The purpose of any form input about the user is identified in code when the purpose is defined in HTML.

WGAC 2 criterion 1.3.5 Identify Input Purpose (AA)
Category Forms and Inputs
ACT Rules

WCAG 2 criterion

1.3.5 Identify Input Purpose (Level AA)

Tools and requirements

  • Manual Evaluation
  • Siteimprove (Policy)
  • Web browser inspector tool

Test procedure

This test asks you to evaluate webforms. You can utilize the Siteimprove policy "Find Forms" to find forms to evaluate. When you come across a webform, if any field asks for data about the user then that field must autocomplete functionality.

Autocomplete support is achieved with the aptly named "autocomplete" attribute in HTML. The autocomplete attribute is applied to the tags <input>, <select>, <textarea>, and <form>. The value of the autocomplete attribute must match the value referenced in the W3C WCAG 2.2 official document (https://www.w3.org/TR/WCAG22/#input-purposes).

Examples

Example for a text input asking for the user's first name:
<input type="text" id="first-name" autocomplete="given-name" />

Example for a text input asking for the user's email address:
<input type="text" id="user-email" autocomplete="email" />

Example for a select box asking for the user's state of residence:
<select name="state" id="address-state" autocomplete="address-level1" />

Names and Addresses

Names can be implemented in two different ways. The first is asking for the user's full name in one input field. The second is asking for each name in separate input fields. Either option is completely valid, but it will change the autocomplete values you would expect to see.

Addresses can be a bit more complex when it comes to ensuring that the appropriate autocomplete attributes are used. Normally, addresses in forms are going to be split into multiple different inputs. You'll have one input for the street name and number, a separate input for the town or city, another separate one for the state/province, and another for the zip code.

You would want to see the following autocomplete values for names and addresses (note: US only, different countries have different rules for addresses). The table below is not exhaustive. Reference the official W3C WCAG 2.2 documentation for more details.

Form Field Expected Autocomplete Value
User's Name (if asking for the full name in one input) name
User's First Name given-name
User's Middle Name additional-name
User's Last Name family-name
User's Suffix (Jr./Sr./II/III/IV etc.) honorific-suffix
Address Street Name street-address
Address City/Town Name address-level2
Address State address-level1
Address Zip Code postal-code
Address Country country-name (full name) or country (code)
Email Address email

AI Prompt