WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: HTML Fieldset missing a Legend

for

Number of posts in this thread: 10 (In chronological order)

From: Laurence Lewis
Date: Wed, Nov 03 2021 9:05PM
Subject: HTML Fieldset missing a Legend
No previous message | Next message →

The HTML Spec says that the <legend> element is optional for a <fieldset>.
I am interested to understand if not having a Legend is a WCAG 1.3.1 Info
and Relationships or 3.2.2 Labels or Instructions.
I do not believe not naming a Fieldset is a WCAG fail for either sc, and
would appreciate the opinions of others. Thanks.

Regards
Laurence Lewis
Accessibility Senior Specialist - Telstra

From: wolfgang.berndorfer
Date: Thu, Nov 04 2021 9:00AM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

If I navigate in an option group (e.g., Yes/No) without fieldset and legend, a Screen Reader can't technically announce the associated Question.

So, for me it would be a clear failure of 1.3.1 and 4.1.2.

An exception probably would be if You gave each option a clarifying name with aria-label etc.
I wouldn't generally advice this technique because of double needs for managing updates.

But also: For UX for SR keep the legend short and precise:
Listening to a verbose description for each item of a group of options or checkboxes is annoying.

Wolfgang

From: Patrick H. Lauke
Date: Thu, Nov 04 2021 9:11AM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

On 04/11/2021 03:05, Laurence Lewis wrote:
> The HTML Spec says that the <legend> element is optional for a <fieldset>.
> I am interested to understand if not having a Legend is a WCAG 1.3.1 Info
> and Relationships or 3.2.2 Labels or Instructions.
> I do not believe not naming a Fieldset is a WCAG fail for either sc, and
> would appreciate the opinions of others. Thanks.

It's only a failure of 1.3.1 if there IS something there in the page,
visually, conveyed through presentation (i.e. something that does act as
a legend in this case) that hasn't been correctly marked up as such. If
there isn't anything currently that you can see, it can't fail 1.3.1

If currently the whole group doesn't make any sense (to anybody,
including sighted users) without a legend included, then there is an
argument that it fails 3.2.2. This is more vague/opinionated.

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Mark Magennis
Date: Thu, Nov 04 2021 9:53AM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

Wolfgang,

The latest versions of JAWS and NVDA seem to no longer announce the legend for each field in the fieldset. Is that your experience too? I always suspected this could be a bit of a pain.

Mark

From: wolfgang.berndorfer
Date: Thu, Nov 04 2021 12:21PM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

Hi Marc,

If SR ignored legend in fieldset despite spec, this would make me worrying.

But perhaps this is a matter of configuration.
SR users even can choose settings that ignore all alt-text, responding to bad experience.

I'll have to watch SR behavior.

Wolfgang


From: Patrick H. Lauke
Date: Thu, Nov 04 2021 12:24PM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

On 04/11/2021 18:21, = EMAIL ADDRESS REMOVED = wrote:
> If SR ignored legend in fieldset despite spec, this would make me worrying.

They don't ignore legend, but they only announce the legend when an SR
user enters a fieldset area, rather than for each and every
focusable/form control inside it (same way they only announce the name
of a named region when you enter it).

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: wolfgang.berndorfer
Date: Thu, Nov 04 2021 1:00PM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

Patrick,

Thus I get the info of the legend-name entering with *arrow keys*.

But what would be the best realization, if I explore a form with tab-key or in jaws with jaws-key+F5?
I'd only hear 'Yes' or 'No', 'red', 'green' an 'blue' as options or 'Accept' in a checkbox for what?

Should the related Question be simply named in the heading, presupposing that users know how to deal name "Yes" etc. with their AT?


From: Patrick H. Lauke
Date: Thu, Nov 04 2021 1:24PM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

On 04/11/2021 19:00, = EMAIL ADDRESS REMOVED = wrote:
> Thus I get the info of the legend-name entering with *arrow keys*.

No, you also hear it when you jumped from your previous focus point
outside of the fieldset to a focus point inside the fieldset (with Tab etc)

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Steve Green
Date: Thu, Nov 04 2021 1:35PM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | Next message →

You also get the legend name when you tab into a fieldset - it is prepended to the label of whichever form control is announced.

Steve Green
Managing Director
Test Partners Ltd


From: Laurence Lewis
Date: Thu, Nov 04 2021 2:44PM
Subject: Re: HTML Fieldset missing a Legend
← Previous message | No next message

If there is a two radio button group being Yes/No, wrapped in a Fieldset
without a legend, it would make no sense to anyone and thus fails 3.2.2.


A visible heading before the group, that visually labels the group, but is
not associated to the group programmatically (Legend), it is a 1.3.1 Fail.


If the radio buttons make sense on their own and are wrapped in a Fieldset
without a Legend, and no visible label, it fails neither.


Either way there is some level of subjectivity and should be considered on
a case-by-case basis.


Please correct me if I have misinterpreted and thanks @Patrick H. Lauke