- Level
- A
- Since
- WCAG 2.0
- Entries
- 38 / 193
3.2.2 On Input
Changing a setting, such as picking an option from a list or ticking a box, must not by itself take a person somewhere else unless they were told beforehand.
/ What it requires
Choosing a value is not the same as asking for something to happen. This criterion says that changing the setting of a control, by selecting an option, ticking a checkbox or typing into a field, must not automatically cause a change of context. A change of context is a major shift: a new page loads, a new window opens, focus jumps elsewhere, or the content is rearranged so that the page means something different. People who cannot see the whole screen lose their place when that happens.
The line runs between changing a value and activating a control. Pressing a button or following a link may do anything, because the person asked for it. Updating part of the page after a choice, such as showing extra fields or filtering a list, is not a change of context as long as focus stays put and the page keeps its meaning. The criterion has one way out: the behaviour is allowed if the person is told about it before they use the control.
/ How pages fail it
- A select element loads another page as soon as an option is chosen, with no button to confirm the choice.
- A form submits itself when the last field is filled in or a checkbox is ticked.
- Focus leaps to the next field after a fixed number of characters, for instance between the parts of a phone number, and nothing on the page says so.
- Selecting a radio button opens a new window.
- A language or country select reloads the whole page in another version the moment its value changes.
/ How to check it yourself
- Tab to every select and change its value with the arrow keys alone. Watch whether the page navigates, submits or moves focus before you press Enter.
- Tick each checkbox and choose each radio button with the Space bar and the arrow keys, and look for the same three things.
- Type into the text fields, including fields split into several boxes, and note any point where focus moves without you pressing Tab.
- Search the source for onchange handlers that call submit() or set location, which are the usual cause.
- Where input does trigger a change of context, check that a visible instruction placed before the control announces it.
/ How to fix it
- Add a button element of type submit next to the select and navigate when the form is submitted, not on the change event.
- Remove form.submit() calls from change and blur handlers and let the person send the form with a button.
- Open new windows only from links and buttons, never from the change of a radio button, a checkbox or a select.
- When a choice has to update the page, change the content that follows the control in place and leave focus where it is.
- If automatic behaviour has to stay, describe it in text placed before the control, so that it is read before the control is reached.
/ What our scanner checks
The one automated rule filed here, HTML_CodeSniffer H32.2, reports a form element with no submit button: no input of type submit or image, no button that submits, and no outside button tied to it by the form attribute. That hints that a form may submit on change, and proves nothing. The check never operates a control, so a select that navigates on change goes undetected.
/ Who fails it, in our own measurements
| Body | Sector | Instances | Score |
|---|---|---|---|
| Nürnberg | city · DE | 5 | 5 |
| Gliwice | city · PL | 2 | 13 |
| Harris County | government · US | 2 | 19 |
| Państwowa Inspekcja Pracy | government · PL | 2 | 10 |
| Phoenix | city · US | 2 | 1 |
| Uniwersytet Łódzki | education · PL | 2 | 9 |
| Warszawski Uniwersytet Medyczny | education · PL | 2 | 13 |
| Austin | city · US | 1 | 13 |
| Baltimore | city · US | 1 | 7 |
| Boston | city · US | 1 | 6 |
| Bundesministerium der Finanzen | government · DE | 1 | 13 |
| Dallas | city · US | 1 | 23 |
| Gdańsk | city · PL | 1 | 2 |
| Houston | city · US | 1 | 7 |
| Indianapolis | city · US | 1 | 18 |
| Katowice | city · PL | 1 | 12 |
| King County | government · US | 1 | 13 |
| Krajowa Administracja Skarbowa | government · PL | 1 | 5 |
| Köln | city · DE | 1 | 16 |
| Las Vegas | city · US | 1 | 8 |
| Miami-Dade County | government · US | 1 | 20 |
| Narodowy Instytut Zdrowia Publicznego | health · PL | 1 | 25 |
| Nashville | city · US | 1 | 14 |
| New Orleans | city · US | 1 | 7 |
| New York Public Library | culture · US | 1 | 24 |
| Philadelphia | city · US | 1 | 8 |
| Politechnika Wrocławska | education · PL | 1 | 17 |
| Polski Instytut Sztuki Filmowej | culture · PL | 1 | 7 |
| Poznań | city · PL | 1 | 1 |
| Radom | city · PL | 1 | 2 |
| Rzeszów | city · PL | 1 | 8 |
| Seattle | city · US | 1 | 12 |
| State of Florida | government · US | 1 | 8 |
| State of Pennsylvania | government · US | 1 | 21 |
| Technische Universität München | education · DE | 1 | 12 |
| Uniwersytet Jagielloński | education · PL | 1 | 1 |
| Uniwersytet Warszawski | education · PL | 1 | 3 |
| Veterans Affairs | government · US | 1 | 33 |
One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.
/ Questions about this criterion
What counts as a change of context in WCAG?
WCAG defines it as a major change that can disorient people who cannot see the whole page at once: a change of user agent, of viewport, of focus, or of content that alters the meaning of the page. Opening a new window, loading another page and moving focus are examples. A change of content alone is not always a change of context.
Can a dropdown go to another page when an option is selected?
Not without warning. A select that loads a new page on change fails this criterion, and keyboard users are hit hardest, because moving through the options with the arrow keys can trigger the jump on the very first one. Either add a button that performs the navigation, or state before the control that choosing an option opens a new page.
Does filtering a list when a checkbox is ticked fail On Input?
Usually not. Showing more fields, updating a price or filtering results below the control changes content and is not a change of context, provided focus stays on the control and the page keeps its meaning. It becomes a failure when the update moves focus, replaces the whole page or sends the form. Announcing such updates to screen readers belongs to 4.1.3 Status Messages.
