E-mail List Archives
Thread: Programmatic relationship between form controls and labels
Number of posts in this thread: 9 (In chronological order)
From: Steve Green
Date: Tue, Nov 05 2024 3:50AM
Subject: Programmatic relationship between form controls and labels
No previous message | Next message →
WCAG SC 1.3.1 requires that there is a programmatic relationship between form controls and their labels. I am testing a website where there appears to be no such relationship, yet it doesn't seem right to report a non-conformance. I welcome your thoughts on this. For the purpose of this discussion, I am only interested in WCAG conformance, not the user experience.
There are three relevant elements:
1. An h2 heading containing the word "Search".
2. A label element containing the word "Search". This is hidden visually, using the "clip" technique.
3. A textbox that is programmatically associated with the hidden label element, so it has an accessible name.
I can only see two interpretations, each of which results in a non-conformance.
1. The h2 heading is considered to be the visible label for the textbox. They are not programmatically related, so there is a non-conformance of SC 1.3.1.
2. The h2 heading is not considered to be the visible label for the textbox. In this case, there is no visible label, which is a non-conformance of SC 3.3.2 (Labels of Instructions).
Is there a third interpretation that does not result in any non-conformances?
Regards,
Steve Green
Managing Director
Test Partners Ltd
020 3002 4176 (direct)
0800 612 2780 (switchboard)
07957 246 276 (mobile)
020 7692 5517 (fax)
Skype: testpartners
= EMAIL ADDRESS REMOVED =
www.testpartners.co.uk
Connect to me on LinkedIn - http://uk.linkedin.com/in/stevegreen2
From: Patrick H. Lauke
Date: Tue, Nov 05 2024 4:26AM
Subject: Re: Programmatic relationship between form controls and labels
← Previous message | Next message →
My take here would be:
1.3.1 isn't as cut and dry as that. It doesn't necessarily require the
programmatic association, only that if something is presented visually,
the same information is also available programmatically. The point of
defining the relationship in the case of labels and form controls is
primarily to make sure the form control is, as a result, given an
appropriate accessible name (otherwise it'd fail both 1.3.1 and 4.1.2).
If the same relationship ("this text box is for 'Search'") is provided
in a different way, but the end result is still correct, then it doesn't
pose any barriers/problems to users, so I'd say that this is all
passing? (Same if the text box used, say, aria-label="Search")
Yes, I can already hear the argument about "but if it's marked up as a
<label> then users can click/tap on the label to set focus to the text
box" ... but that's a nice-to-have, not a requirement (and not having
that is not a failure).
P
--
Patrick H. Lauke
* https://www.splintered.co.uk/
* https://github.com/patrickhlauke
* https://flickr.com/photos/redux/
* https://mastodon.social/@patrick_h_lauke
From: Laura Fathauer
Date: Tue, Nov 05 2024 6:19AM
Subject: Re: Programmatic relationship between form controls and labels
← Previous message | Next message →
I agree with Patrick's reading of 1.3.1; in this case the visual
information is also available programmatically, so I would not fail this
under either 1.3.1 nor 3.3.2.
Laura
On Tue, Nov 5, 2024 at 6:33 AM Patrick H. Lauke < = EMAIL ADDRESS REMOVED = >
wrote:
> My take here would be:
>
> 1.3.1 isn't as cut and dry as that. It doesn't necessarily require the
> programmatic association, only that if something is presented visually,
> the same information is also available programmatically. The point of
> defining the relationship in the case of labels and form controls is
> primarily to make sure the form control is, as a result, given an
> appropriate accessible name (otherwise it'd fail both 1.3.1 and 4.1.2).
> If the same relationship ("this text box is for 'Search'") is provided
> in a different way, but the end result is still correct, then it doesn't
> pose any barriers/problems to users, so I'd say that this is all
> passing? (Same if the text box used, say, aria-label="Search")
>
> Yes, I can already hear the argument about "but if it's marked up as a
> <label> then users can click/tap on the label to set focus to the text
> box" ... but that's a nice-to-have, not a requirement (and not having
> that is not a failure).
>
> P
> --
> Patrick H. Lauke
>
> * https://www.splintered.co.uk/
> * https://github.com/patrickhlauke
> * https://flickr.com/photos/redux/
> * https://mastodon.social/@patrick_h_lauke
>
> > > > >
From: Steve Green
Date: Tue, Nov 05 2024 6:55AM
Subject: Re: Programmatic relationship between form controls andlabels
← Previous message | Next message →
So, it seems there is a broad agreement that in this particular case, the relationship between the form control and visual label does not need to be conveyed programmatically because the information (i.e. the accessible name) is conveyed programmatically.
That seems to be a reasonable conclusion. Now I'm wondering if there are any other groups of related elements where it would not be reasonable.
Thanks for everyone's input on this.
Steve
From: Kevin Prince
Date: Sun, Nov 10 2024 10:29PM
Subject: Re: Programmatic relationship between form controls and labels
← Previous message | Next message →
I realise this is a hypothetical however worth considering that, in a multi-lingual scenario, there are two elements that will need updating and one is not obvious to a sighted editor. It's fine as it stands but will likely fail 2.5.3 if one changes without the other.
Interesting point - if there is a label but it's not in the language of the site is that a fail of 2.4.6?
Kevin Prince
Accessibility Consultant
Access Advisors
Phone: +64212220638
Web: https://accessadvisors.nz/
If you have any access needs consider joining our research panel where you can be paid to help improve digital accessibility in New Zealand.
I work flexibly and am sending this message now because it suits my work schedule. However I don't anticipate that you will read, respond to or action it outside of your regular working hours.
From: Steve Green
Date: Mon, Nov 11 2024 3:14AM
Subject: Re: Programmatic relationship between form controls andlabels
← Previous message | Next message →
If the label has the correct "lang" attribute and is correct, but in the wrong language, I would say it doesn't violate any success criteria. Everyone who doesn't speak that language is equally affected.
Steve
From: Kevin Prince
Date: Mon, Nov 11 2024 6:02AM
Subject: Re: Programmatic relationship between form controlsandlabels
← Previous message | Next message →
But it is only visible to AT ;)
Kevin Prince
Accessibility Consultant
Access Advisors
Phone: +64212220638
Web: https://accessadvisors.nz<https://accessadvisors.nz/>
[image001.png]
If you have any access needs why not join our research panel<https://accessadvisors.nz/research-participants/> where you can be paid to help improve digital accessibility in New Zealand.
I work flexibly and am sending this message now because it suits my work schedule. However I don't expect that you will read, respond to or action it outside of your regular working hours.
From: WebAIM-Forum < = EMAIL ADDRESS REMOVED = > on behalf of Steve Green < = EMAIL ADDRESS REMOVED = >
Sent: Monday, November 11, 2024 11:14:03 PM
To: WebAIM Discussion List < = EMAIL ADDRESS REMOVED = >
Subject: Re: [WebAIM] Programmatic relationship between form controls and labels
If the label has the correct "lang" attribute and is correct, but in the wrong language, I would say it doesn't violate any success criteria. Everyone who doesn't speak that language is equally affected.
Steve
From: Steve Green
Date: Mon, Nov 11 2024 6:13AM
Subject: Re: Programmatic relationship between formcontrolsandlabels
← Previous message | Next message →
In that case it would fail SC 2.5.3 because it doesn't match the visible label.
From: Birkir R. Gunnarsson
Date: Mon, Nov 11 2024 6:43AM
Subject: Re: Programmatic relationship between form controls and labels
← Previous message | No next message
If visible and programmatic labels are in a different language, then we
definitely have a failure of "label in name".
The search input meets the visible label because it is visually labeled by
its adjacent button (g167):
https://www.w3.org/WAI/WCAG22/Techniques/general/G167.html
So I don't really see any fails with the original scenario.
Not ideal, no, but passing WCAG, yeah.
On Mon, Nov 11, 2024 at 8:13 AM Steve Green < = EMAIL ADDRESS REMOVED = >
wrote:
> In that case it would fail SC 2.5.3 because it doesn't match the visible
> label.
>