Forms
Radio validation
Investigate required radio groups, native constraint validation, and focus placement.
Purpose
Reproduce how a required radio group behaves when a form is submitted with no selection, including where focus lands and what the browser exposes.
When to use it
- A required choice must be made before submission.
- The team wants to rely on native browser validation rather than a custom widget.
When not to use it
- The group is optional; do not mark it required to demonstrate validation.
- A custom validation pattern is already in place and tested.
Implementation
- Use a fieldset and legend for the group.
- Put required on the native radio inputs.
- Do not add redundant aria-required to native required inputs.
- Let the browser prevent submission and report the invalid control.
Read the implementation guide
Keyboard behavior
- Arrow keys move between radio options.
- Space selects the focused option.
- Submitting an empty group leaves focus on the first invalid radio in tested browsers.
User preferences
- The visible radio boundary and focus ring must meet non-text contrast.
- Native validation bubbles are browser-controlled and may not be customizable.
Common implementation mistakes
- Adding role=radiogroup or aria-required to a native fieldset without evidence.
- Replacing radios with clickable divs.
- Assuming every browser moves focus to the same element.
How to test it
- Submit with no selection and record document.activeElement.
- Select with the keyboard and submit successfully.
- Test in Chromium and Firefox; record the browser-specific result.
Known limitations
- Voice Control and real screen-reader confirmation remain outstanding.
- The lab records browser behavior; it does not change upstream radio positioning.
Experiments involving this component
Alternative implementation Prototype available
A focused reproduction of required radio-group submission, native constraint validation, and browser focus placement.
Components: Radio validation, Form controls. Review: pending.
User preferences: Forced colours, Reduced motion, Large text, Narrow viewport and reflow, No JavaScript.
Accessibility concerns: Voice control untested, Real screen-reader testing outstanding.
Automated evidence: 4 of 4 fixture routes collected (complete). Manual test definitions: 10; published evidence records none as completed.
Evidence: 5 of 5 routes collected. Human review pending.
Evaluate Registered demonstration
Test scenarios
- radio-required: Submit an empty required radio group and inspect focus and validity (form)
Sources and history
Source lock: v3.14.0. This page describes an independent lab fixture, not an official USWDS example.