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

-----Original Message-----
From: awebster [mailto: <EMAIL REMOVED> ]
Sent: Thursday, August 05, 2004 9:40 AM
To: WebAIM Discussion List
Subject: [WebAIM] Forms - 1 label for 2 selects?


Hi,

I have the form below which I want to be accessible. I have added labels so
that users know which label relates to which input field, but can I have one
label for two inputs, as I have done below for "Expiry Date"? I don't really
want to put Expiry Month and then Expiry Year.

Any advice would be greatly appreciated

Thanks
Anthony





Number:
<input type=text name="ohccnum" value="" size=16
maxlength=50>


Name:
<input type=text name="ohccname" value="test" size=16
maxlength=50>


Expiry Date:


01
02
03
04
05
06
07
08
09
10
11
12


2004
2005
2006
2007
2008
2009






----
To subscribe or unsubscribe, visit http://www.webaim.org/discussion/