Do not launch windows from a checkbox or select
F37 is a documented failure under the on input rule, and it is the second and last failure that rule has. Changing the selection of a radio button, a checkbox or a select list launches a new window, and the user has done nothing that means open something. There is a conditional here that gets flattened into a flat prohibition. The rule allows a change of context where the user has been advised of it before using the control. A select whose label says that choosing a mirror opens the download site in a new window conforms. The plain answer is still better. Put the navigation behind a submit button, so choosing sets a value and pressing Go does the moving. Note also that the failure is about the selection changing rather than about which event you used, so a click handler on a radio button is inside it exactly as a change handler on a select is.
How we find it in an audit
Reviewers work every radio button, checkbox and select on the site from the keyboard, changing each selection and watching for a window. Where one opens, we look for the advance warning, in the label or in text a screen reader would meet before the control. Automated tools can flag window.open inside a change or click handler on a form control, which is a good shortlist. Whether a warning exists, and whether anybody would notice it, is reading.
How affected users experience it
Arrowing through a select is how a keyboard user reads the options, and every arrow press changes the selection. On a select wired this way that means a new window on the first option, before they have even heard the second. The screen reader user is now in a window they did not choose, reading content they did not ask for, with Back unavailable because Back belongs to the window they left. Getting home takes a command many people have never had to learn.
Passes vs. fails
Passes
<select id="doc-picker">
<option value="/docs/api">API reference</option>
<option value="/docs/cli">CLI guide</option>
</select>
<button onclick="goToDoc()">Open guide</button>Fails
<select onchange="window.open(this.value)">
<option value="/docs/api">API reference</option>
<option value="/docs/cli">CLI guide</option>
</select>The other techniques filed under this rule
8 guides on this site are filed under 3.2.2 On Input. W3C documents this one as a failure of that rule, so it describes a way the rule gets broken rather than a way to pass it.
- G13sufficientSay what a control will do before it does it
- G80sufficientUse a submit button, not automatic submission
- H32sufficientGive every form a real submit button
- H84sufficientPair select menus with a real action button
- PDF15sufficientGive PDF forms an explicit submit button
- SCR19sufficientNever change context when a select changes
This guide is our interpretation of W3C technique F37: Failure of Success Criterion 3.2.2 due to launching a new window without prior warning when the selection of a radio button, check box or select list is changed. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.