SCR19: Safe Dynamic Selects Without Context Hijacking

Marcus
digitalwcagformsjavascriptscreen readerskeyboard accessibility

Marcus · AI Research Engine

Analytical lens: Operational Capacity

Digital accessibility, WCAG, web development

AI-assisted · Source-linked · Editorially reviewed · Methodology

Trust note

This article was drafted with AI assistance, reviewed against accessibility.chat editorial standards, and should be treated as research and education rather than legal advice. We prioritize primary sources and correct material errors.

Smiling woman in red blazer using a laptop at a café table, enjoying her workday.
Photo by Marcus Aurelius on Pexels

WCAG 2.0 shipped in 2008. Sixteen years later, dynamic <select> interactions still break screen readers on production sites daily. Technique SCR19 (opens in new window) exists precisely because this pattern — a continent dropdown that updates a country list — is everywhere, and most implementations get it wrong in ways that aren't obvious until you're navigating with a screen reader.

The technique is deceptively simple. The failure mode is not.

The Technique

SCR19 (opens in new window) describes a specific, constrained way to use onchange on a <select> element: you can trigger DOM updates to other elements on the page, but only in ways that don't cause a change of context. The technique is listed as Sufficient for two success criteria:

The canonical example in the W3C document: a continent <select> updates a country <select>. When the user picks "Europe," the country list repopulates with European nations. All data lives on the page — no server round-trips. The onchange event fires countryChange(), which rewrites the second select's options via the DOM.

Here's the structural pattern the technique describes:

HTML
<!-- Continent select: the trigger -->
<label for="continent">Select a continent:</label>
<select id="continent" onchange="countryChange(this)">
<option value="empty">Select a continent</option>
<option value="North America">North America</option>
<option value="Europe">Europe</option>
<!-- ... -->
</select>
<!-- Country select: comes AFTER in reading order -->
<label for="country">Select a country:</label>
<select id="country">
<option value="">Select a country</option>
</select>
JAVASCRIPT
var countryLists = [];
countryLists["North America"] = ["Canada", "Mexico", "United States"];
countryLists["Europe"] = ["France", "Germany", "Spain"];
// ...
function countryChange(selectObj) {
var selectedContinent = selectObj.value;
var countrySelect = document.getElementById("country");
// Clear existing options
countrySelect.options.length = 0;
// Populate new options
var countries = countryLists[selectedContinent] || [];
countries.forEach(function(country) {
countrySelect.options[countrySelect.options.length] = new Option(country, country);
});
}

Two structural rules make this work accessibly. First: the modified element must appear after the trigger in DOM reading order. Second: no automatic navigation, form submission, or focus movement should occur.

Why This Matters

When teams violate the constraints SCR19 defines, the failure pattern is consistent and damaging.

Screen reader users rely on a predictable reading order. If selecting a continent causes focus to jump to the country list — or worse, triggers a page reload — the user loses their place entirely. They may not know what changed, where they are, or how to proceed. That's not a minor inconvenience. For someone navigating a complex form with a screen reader, unexpected context shifts can mean having to restart the entire interaction.

Keyboard-only users face a related problem. If onchange fires on every keypress while arrowing through options (a known browser behavior difference), cascading DOM updates can interfere with navigation before the user has finished selecting.

The reading-order constraint — modified element comes after the trigger — isn't arbitrary. Assistive technologies announce content as they encounter it in the DOM. If the country select lives above the continent select in the markup, a screen reader user may have already passed it before the update fires. They'll never hear the new options unless they manually navigate backward, and nothing tells them they should.

This is the kind of failure that automated testing tools miss entirely. As our research on testing methodology shows, automated tools top out around 37% detection of real accessibility barriers — and DOM-order issues in dynamic interactions are squarely in the 63% that only manual or AT-based testing catches.

How It Works

The technique's elegance is in what it doesn't do. No focus management. No page navigation. No server calls. The onchange handler updates options in a select that follows the trigger in reading order, and stops there.

All data is embedded in the page at load time — the countryLists array is populated upfront. This matters for two reasons: it eliminates async timing issues (no race conditions where the select updates before data arrives), and it keeps the interaction fully functional without network dependency.

The reading-order requirement is the constraint teams most often overlook. In a typical two-column form layout, designers may place the country select to the left of or above the continent select for visual reasons. The DOM order may not match the visual order. SCR19 requires the DOM order to be correct — the modified element must come after the trigger in the markup, regardless of how CSS positions it visually.

CriterionLevelWhat SCR19 ProvidesKey Constraint
3.2.2 On Input (opens in new window)AASufficient techniqueNo context change on selection
3.2.5 Change on Request (opens in new window)AAASufficient techniqueNo automatic navigation or submission

Applying This

For development teams, the practical checklist for SCR19 compliance is short but requires discipline:

In code review:

  • Confirm the dependent <select> appears after the trigger <select> in the HTML source, not just visually.
  • Verify onchange does not call any navigation function, form.submit(), or window.location assignment.
  • Check that focus is not programmatically moved after the update fires.
  • Confirm all option data is available at page load — no async fetches inside the handler.

In automated testing: No current automated tool reliably catches DOM-order violations in dynamic select patterns. This is a manual check. Add it to your code review checklist and your QA script for any form containing dependent selects.

In design handoff: If a designer specifies a layout where the dependent select appears above the trigger visually, flag it immediately. Either reorder the DOM and use CSS to achieve the visual layout, or escalate the conflict. Don't silently ship the wrong DOM order.

Quick wins for existing implementations:

  1. Audit all multi-select form patterns for DOM reading order.
  2. Test with a screen reader (NVDA + Firefox, VoiceOver + Safari) — navigate to the trigger select, change a value, then arrow forward. Do you encounter the updated options naturally? If you have to backtrack, the order is wrong.
  3. Verify no onchange handler triggers navigation or submission.

For teams building design systems, this pattern deserves a dedicated component with the reading-order constraint baked in — not left to individual implementers. The compliance fragmentation problem means teams are already juggling multiple standards; a well-documented, pre-built dependent-select component removes one more decision point.

CORS Perspective

From an operational capacity lens, SCR19 is a high-leverage, low-cost fix — exactly the kind of "chop list" item that solves a disproportionate share of dynamic form complaints. The implementation effort is minimal; the constraint (DOM reading order) is a one-time architectural decision that costs nothing once it's a team standard. The real operational risk is the gap between what automated testing catches and what screen reader users actually encounter — a gap our testing methodology research documents in detail. Teams that rely solely on automated CI/CD accessibility gates will ship SCR19 violations confidently, because the tools won't flag them. The strategic fix is adding dependent-select patterns to manual QA scripts and design system documentation, turning a recurring implementation risk into a solved problem.

About the Marcus lens

An operational lens on digital accessibility. Frames findings around what implementation and maintenance actually require — WCAG conformance, engineering effort, and day-to-day web development practice.

Marcus is an AI analyst lens, not a human staff member. It helps frame this article through a consistent accessibility perspective.

Specialization: Digital accessibility, WCAG, web development

View all articles using this lens →

Transparency Disclosure

This article was drafted with AI assistance and reviewed against our editorial methodology. We disclose that process so readers can judge the work clearly.