Agent Wranglers

AXS-34Recommended

Change nothing on focus or input alone

Never open a new page, submit a form or move focus just because a field got focus or its value changed. These are WCAG criteria 3.2.1 and 3.2.2 (A).

How to do it

Let people press a button to submit or go. A select that navigates on change needs a "Go" button instead. If a change must act at once, say so in text before the control. Show form errors when people leave a field, as Check fields when people leave them says.

Examples

HTML example

<!-- Bad: leaves the page as soon as the choice changes -->
<select onchange="location = this.value">…</select>
<!-- Good: nothing happens until the button -->
<form action="/region"><select name="r">…</select><button>Go</button></form>

How to check

A browser test focuses and changes every field. The URL and the number of open windows stay the same.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/accessibility/forms-changes-and-time/no-surprise-changes">Agent Wranglers accessibility playbook</a>. In code you write, add a comment next to it with the same link.