How do I label a group of radio boxes for WCAG / 508 Compliance? Is ASP.NET doing it wrong?
Posted
by Mark Brittingham
on Stack Overflow
See other posts from Stack Overflow
or by Mark Brittingham
Published on 2010-05-04T02:21:36Z
Indexed on
2010/05/04
2:28 UTC
Read the original article
Hit count: 357
I am trying to bring an existing web site into greater conformance with WCAG 2.0 Guidelines and am a bit confused over the output emitted by Microsoft (ASP.NET 4.0 although it was the same in 3.5).
Suppose you have a question like: "How would you rate your health?" and a set of 5 answers created using an ASP.NET RadioButtonList. I place the question in an asp:Label with an "AssociatedControlID" that matches the ID of the RadioButtonList (e.g. "SelfRatingBox"). Seems pretty easy...
Only the output that is generated has an html "label" with a "For" that is equal to the ID of a table that wraps up the RadioButtons. I assumed that this would work with page readers but our 508 compliance guy is saying that the reader isn't associating the label with the radio controls.
The WCAG guidelines indicate that you have to use a fieldset around the entire group and a legend to capture the associated text (the question).
So what gives? It would be ideal if MS could take my label and the radiobuttonlist and generate the appropriate fieldset and legend tags but it seems pretty clear that to achieve WCAG compliance, I'll have to roll my own. Is this correct or am I missing something?
© Stack Overflow or respective owner