WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Forms - 1 label for 2 selects?

for

From: Michael Moore
Date: Aug 5, 2004 12:31PM


Hi,

you wrote: ...I don't really want to put Expiry Month and then Expiry Year.

Here is an option for you to consider: (for info on the "hidden" style see
http://www.webaim.org/techniques/articles/hiddentext - the method outlined
in this article is mostly accessible but can cause problems for text only
browsers - think lynx, the use of the field set and title attributes
provides added support and together with the hidden labels will make the
site work for just about anyone)

Use the fieldset element and the legend and title attributes (This will work
best if you use a bit of css to format the fieldset)


Please enter the expiry date
Month

<select name="month" id="month"
title="month">
01
02
03
04
05
06
07
08
09
10
11
12

Year

2004
2005
2006
2007
2008
2009



* Another option that is accessible for most users is to use just the field
set with title attributes on the select element. Fieldset lets the user
know that these elements belong together and title will tell them what each
one is.

Mike Moore