Ability to group radio buttons / checkboxes within sub-headings
See original GitHub issueHi.
I’m wondering how best to support radio buttons (and checkboxes) which have sub-groups with headings?
Currently, you can use multiple govukRadios
macros which share the same name
attribute, however because they use a data-module
attribute to scope the conditional reveals, these don’t work properly across the groups.
Alternatively, you can using a single macro and put headings in using divider
s, but these don’t currently support HTML markup.
On a related not, it’s unclear whether the best output would be nested <fieldset>
s with <legend>
s, or a single <fieldset>
with headings and either aria attributes or visually-hidden prefixes to associate labels with their headings.
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (22 by maintainers)
Top Results From Across the Web
Checkboxes vs. Radio Buttons - Nielsen Norman Group
Twelve usability issues for checkboxes and radio buttons. ... Use subheads to break up a long list of checkboxes into logical groups.
Read more >Grouping Controls | Web Accessibility Initiative (WAI) - W3C
Radio buttons ; Checkboxes; Related fields. Associating related controls with WAI-ARIA; Grouping items in select elements. Grouping needs to be carried out ...
Read more >Using Radio Buttons and Check Boxes - DocuSign
Using radio buttons and checkboxes in documents gives the form creator the ability to request information with a single click or multiple ...
Read more >What's more accessible? 1. Multiple fieldsets of checkboxes ... - Twitter
Single fieldset of checkboxes with subheadings ... Ability to group radio buttons / checkboxes within sub-headings · Issue #1079 · alphagov/govuk-fr.
Read more >Microsoft Forms
To change who can fill out your form, click the Share button and in the Send ... as radio button group (if only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve been working on this too so thought I’d share my examples:
1. Multiple fieldsets of checkboxes with legends https://seemly-airmail.glitch.me
2. Multiple fieldsets of checkboxes with legends With aria-describedby on nested fieldsets https://childlike-cinema.glitch.me/
3. Single fieldset of checkboxes with subheadings https://steep-knife.glitch.me
We’re doing some more screen reader testing on Monday.
So far we’ve not tried @frankieroberto’s suggestion above of prefixing (but visually hidden) the nested legends with the parent legend’s text.
I spoke to Frankie and we put together a coded example: https://tricky-fisher.glitch.me/