I agree. While the for attribute is optional, Cake assigns an id attribute to your inputs so it only makes sense that it would assign a for attribute to the associated label.
You said you aren't using the label with an input field, which is the purpose of the label element. If that really is the case then you need to find a different element for your table column header. Since you said you are using th elements, I'm not really sure why you need the label. What is your desired HTML output? On May 9, 3:32 pm, euromark <[email protected]> wrote: > i dont think the "for" element should be omitted for labels > as it is part of it - there are lots of other xhtml elements that > would be more appropriate if there is no id to refer to > > On 9 Mai, 20:21, Zaky Katalan-Ezra <[email protected]> wrote: > > > > > > > I use <th> for column headers, thank you. > > But this wasn't my question. > > How do I omit the automated 'for' attribute for the $this->Html->label. > > > On Sun, May 9, 2010 at 1:01 AM, Andy Dirnberger > > <[email protected]>wrote: > > > > Labels are supposed to be used with input fields. You should be using > > > <th> for table column headers. > > > > On May 8, 4:13 pm, ZAky <[email protected]> wrote: > > > > I am trying to omit the auto generated 'for' attribute for > > > $this->Html->label with no success. > > > > > I tried: > > > > $this->Form->label('status','Status',array('for'=>false [or] null)); > > > > > and this > > > > > $this->Form->label('status','Status',array('label'=>array('for'=>false > > > > [or] null))); > > > > > Just using <?php echo $this->Form->label('status');?> produce > > > > <label for="status">Status</label> > > > > When I use it for table columns header I have no element with > > > > id="status". > > > > The W3C Validation Service also arise a warning about it. > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > with their CakePHP related questions. > > > > > You received this message because you are subscribed to the Google > > > > Groups > > > "CakePHP" group. > > > > To post to this group, send email to [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected]<cake-php%[email protected] > > > > om>For more options, visit this group athttp:// > > > groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<cake-php%[email protected] > > > om>For more options, visit this group at > > >http://groups.google.com/group/cake-php?hl=en > > > -- > > Regards, > > Zaky Katalan-Ezra > > QA Administratorwww.IGeneriX.com > > Sites.IGeneriX.com > > 054-7762312 > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
