W3C home > Mailing lists > Public > www-html@w3.org > October 2003

Label id vs CSS id?

From: Emlyn Addison <emlyn@neinetwork.com>
Date: Tue, 28 Oct 2003 10:02:20 -0500
Message-ID: <037001c39d64$7cf7f060$fe04a8c0@s0024872641>
To: <www-html@w3.org>
Hi Folks,

I discovered an unusual conflict in the <label> requirements for HTML forms. It seems that the "id" attribute in a form element must contain the same name as the "for" attribute in the <label> tag in order for these to be related. But if that form element already had a CSS "id" attribute associated with it (for stylistic reasons), then the <label> tag cannot be associated with it. For example:

<label for="fname">First name:</label> <input type="text" name="firstname" id="redBorder" value="">

So where do I put id="fname" in that form element? Are label and CSS "id" attributes mutually exclusive, or am I missing something??? This seems like an awfully obvious conflict of the "id" attribute, so I'm assuming that there is a syntactical workaround of some sort...

Suggestions, anyone?

Thanks in advance.

Emlyn


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Emlyn Addison
Director of Creative Services
www.RI.gov -  Rhode Island Government Online
401.831.8099 x24
Received on Tuesday, 28 October 2003 10:04:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:58 GMT