question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to group radio buttons / checkboxes within sub-headings

See original GitHub issue

Hi.

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 dividers, 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:open
  • Created 5 years ago
  • Comments:23 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
colinrotherhamcommented, Feb 1, 2019

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.

2reactions
NickColleycommented, Jan 23, 2019

I spoke to Frankie and we put together a coded example: https://tricky-fisher.glitch.me/

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found