Closed cyrax6 closed 11 years ago
Why should a label use :id
?
It currently expands to for="some id". Besides for looking up labels to modify them in say JavaScript we need ids. There appears no format by which ids can be generated for labels. On 9 Aug 2013 05:27, "James Reeves" notifications@github.com wrote:
Why should a label use :id?
— Reply to this email directly or view it on GitHubhttps://github.com/weavejester/hiccup/pull/84#issuecomment-22390990 .
You can add the ID explicitly as an attribute:
(label {:id "label-email"} :email "Email")
(text-field :email)
The reason the for
attribute is the default is that you almost always want a label with for
(after all, that's the only thing that differs a label from plain text), but only occasionally do you want a label with id
(when you want to refer to the label directly via Javascript or perhaps through CSS).
Ash. I see. My current code uses :label directive. Apologies for assuming things On 9 Aug 2013 05:49, "James Reeves" notifications@github.com wrote:
You can add the ID explicitly as an attribute:
(label {:id "label-email"} :email "Email")(text-field :email)
The reason the for attribute is the default is that you almost always want a label with for (after all, that's the only thing that differs a label from plain text), but only occasionally do you want a label with id(when you want to refer to the label directly via Javascript or perhaps through CSS).
— Reply to this email directly or view it on GitHubhttps://github.com/weavejester/hiccup/pull/84#issuecomment-22391942 .
label seems to generate wrong html code. The atom we should use is :id and not :for.