Changing a select, checkbox or field should not submit or navigate unless people are told first. Public form examples.
Picking an option from a list, ticking a box or typing in a field are settings changes. WCAG 2.1 success criterion 3.2.2 says that changing the setting of any user interface component must not automatically cause a change of context (a new page, a new window, a form submitted, focus moved) unless the user was told about the behavior before using the component.
This protects people who cannot see the whole screen at once, such as screen reader users and people using magnification, and people with cognitive disabilities who need predictable results. It also protects keyboard users: in some browsers, arrowing through a select list fires a change event on every option, so an auto-navigating select can make the later options unreachable.
Government pages love shortcuts: choose a clinic location from a drop-down and the page jumps to that location, tick "Receive reminders" and the form submits, enter the fifth ZIP digit and the page reloads. A keyboard user who presses the Down arrow in such a select may land on the next option's page and never get to the rest. The DOJ guidance on web accessibility lists inaccessible forms among common barriers; see common barriers.
<select onchange="location.href = this.value">
<option value="/clinics/north">North clinic</option>
<option value="/clinics/south">South clinic</option>
</select><label for="clinic">Clinic</label>
<select id="clinic" name="clinic">
<option value="/clinics/north">North clinic</option>
<option value="/clinics/south">South clinic</option>
</select>
<button type="button" id="go-clinic">Show clinic</button>
<script>
document.getElementById("go-clinic").onclick =
() => location.href = document.getElementById("clinic").value;
</script>zip.addEventListener("input", () => {
if (zip.value.length === 5) form.submit();
});<label for="zip">ZIP code</label>
<input id="zip" name="zip" inputmode="numeric" autocomplete="postal-code">
<button type="submit">Find offices</button><select name="cycle" onchange="this.form.submit()">
<option>Monthly</option><option>Quarterly</option>
</select><p id="cycle-note">Changing this reloads the page with new totals.</p>
<label for="cycle">Billing cycle</label>
<!-- Advance notice makes this permitted; a button is still safer for
keyboard users who arrow through the options. -->
<select id="cycle" name="cycle" aria-describedby="cycle-note"
onchange="this.form.submit()">
<option>Monthly</option><option>Quarterly</option>
</select>// SwiftUI
Picker("Clinic", selection: $clinic) {
ForEach(clinics) { Text($0.name).tag($0) }
}
.onChange(of: clinic) { _ in navigateToClinic(clinic) }// SwiftUI
Picker("Clinic", selection: $clinic) {
ForEach(clinics) { Text($0.name).tag($0) }
}
Button("Show clinic") { navigateToClinic(clinic) }// Jetpack Compose
Checkbox(
checked = remind,
onCheckedChange = { remind = it; submitPreferences() } // a violation if this submits or navigates
)// Jetpack Compose
Row(verticalAlignment = Alignment.CenterVertically) {
Checkbox(checked = remind, onCheckedChange = { remind = it })
Text("Send me reminders")
}
Button(onClick = { submitPreferences() }) { Text("Save preferences") }onchange, oninput, change and input listeners that call submit, location or window.open.