RE: Proper Coding for Yes/No Questions

Unfortunately, neither JAWS (4.01 or 4.02 beta) or Home Page Reader 3.02
associate legend with radio button controls...

With JAWS, if you "tab" into a radio button group labeled with a legend,
you don't hear the "question" (i.e. legend). If you simply place the
"question" text (in a paragraph, etc) before the series of radio
buttons, JAWS (4.01+) does a *reasonably* good job guessing what text to
associate, and will re-read it before each radio button (e.g. "Are you
smart? Radio button Yes, Are you smart? Radio button No.", which is
JAWS' behavior with standard Windows radio button controls).
Unfortunately, it's not hard to come up with slightly more complex
layout examples that defeat JAWS' ability to identify the "question"
correctly.

HPR reads the "question" (legend or otherwise) along with the first
radio button only. It's a little better, but if there are very many
radio buttons in the group, it's easy to forget the question, and
difficult to re-read it.

Until fieldset and legend are supported by assistive technologies, the
most practical solution seems to be to use select controls instead of
groups of radio buttons. (In an ideal world, you'd think radio buttons
would have been a type of select anyway -- then we wouldn't need the
name attribute to tie them together either...)

Mike


-----Original Message-----
From: w3c-wai-ig-request@w3.org [mailto:w3c-wai-ig-request@w3.org] On
Behalf Of Kynn Bartlett
Sent: Tuesday, March 05, 2002 6:21 PM
To: RUST Randal; WAI (E-mail)
Subject: Re: Proper Coding for Yes/No Questions

At 11:57 AM -0500 3/5/02, RUST Randal wrote:
>I have several forms with simple "yes/no" questions on them.  I need to

>use radio buttons for the selections.
>
>Is the following code correct for accessibility?
>
>----------
>
><label for="smart">Are you smart?</label>
><label for="smartYes">Yes</label><input type="radio" id="smartYes" /> 
><label for="smartNo">No</label><input type="radio" id="smartNo" />

No, but close. You want something like this:

<fieldset>
   <legend>Are you smart?</legend>
   <label for="smartYes">Yes</label>
   <input type="radio" id="smartYes" value="yes" name="smartYes" />
   <label for="smartNo">No</label>
   <input type="radio" id="smartNo" value="no" name="smartNo" />
</fieldset>

Received on Friday, 8 March 2002 16:40:10 UTC