Re: Label id vs CSS id?

Doh! Yes indeed, I should have been using class= not id= for CSS-related
mangling. But for some reason way back I started using "id" instead of
"class" for anything that was form related... Don't ask me why.

Thanks to everyone who responded to this overworked peion.

Emlyn


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
Emlyn Addison
Director of Creative Services
www.RI.gov -  Rhode Island Government Online
401.831.8099 x24

----- Original Message -----
From: "Philip TAYLOR [PC87S-O/XP]" <P.Taylor@Rhul.Ac.Uk>
To: "Emlyn Addison" <emlyn@neinetwork.com>
Cc: <www-html@w3.org>
Sent: Tuesday, October 28, 2003 10:05 AM
Subject: Re: Label id vs CSS id?


> Why could you not (a) use "class" instead of "id" for
>
> id="redBorder"
>
> or (b) use "for='redBorder'", since IDs must be unique ?
>
> Philip Taylor
> --------
> Emlyn Addison wrote:
> >
> > 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...
>

Received on Tuesday, 28 October 2003 10:27:47 UTC