W3C home > Mailing lists > Public > www-html@w3.org > April 2002

RE: Single label for 2 inputs?

From: David Bindel <dbindel@austin.rr.com>
Date: Mon, 29 Apr 2002 06:37:25 -0500
To: <www-html@w3.org>
Message-ID: <000001c1ef72$3c3bd970$0301a8c0@david>
>> I wish to use the same label for 2 separate inputs but what to know
>> how or if it is even allowed.

Nope.  Not allowed.

>> Example:
>> I have a form with 5 options the last being 'other:' with an option
>> to enter the 'other' in a type="text". Now can I use  the one label
>> tag or should I use two or shouldn't I do this at all.

What's the point of this???  You can't click on a label and have TWO
form controls selected.  Think about it: you click the label and it
selects BOTH form fields.  Then you start typing something.  What is the
browser supposed to do: automatically focus on the text box, or go to a
selection in the list box that matches what you type?  This is why you
cannot use the same label for 2 inputs.

What you can do is have a script that when "other" is selected from the
menu it will focus on the "Other" text input box.

David Bindel
Received on Monday, 29 April 2002 07:37:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:59 UTC