ZF-12059: multiCheckbox shouldn't use "for" attribute on the main label
Description
Options :
opt1
opt2
opt3
In the HTML above, the "for" of the first label should be removed because there is no id="options".
Options :
opt1
opt2
opt3
In the HTML above, the "for" of the first label should be removed because there is no id="options".
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2012-02-14T18:40:09.000+0000
Actually, the "for" attribute of labels can point to either the id OR the input name. As such, this is still valid and correct -- there is an input named "options".
Posted by Jérémy Lajotte (pengu) on 2012-02-14T19:03:32.000+0000
Are you sure about that ?
The W3C validator reports an error. And from W3C HTML reference :
http://w3.org/TR/1999/… {quote} for : (IDReference) This attribute explicitly associates the label with a form control. When present, the value of this attribute must be the same as the value of the id attribute of the form control in the same document. When absent, the label being defined is associated with the control inside the label element. {quote}
Posted by Matthew Weier O'Phinney (matthew) on 2012-02-14T19:37:10.000+0000
Mea culpa -- this was evidently in older browsers that such support was implemented. Re-opening. It should point to "options-element" in this case.
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-03T19:11:38.000+0000
What is the best location to make this change? My first thought is to do this (in {{Zend_Form_Decorator_Label::getId}}):
I haven't checked yet to see if this has any unintended consequences, but all Zend_Form and Zend_View tests still pass after the above change.
Posted by Frank Brückner (frosch) on 2012-05-04T08:18:47.000+0000
Patch and unit tests added.
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-15T14:32:36.000+0000
Fixed in trunk r24963
Posted by Martin Hujer (mhujer) on 2012-07-11T07:07:41.000+0000
Tests failing on Windows
Posted by Martin Hujer (mhujer) on 2012-07-11T07:08:28.000+0000
Patch to fix tests on Windows
Posted by Frank Brückner (frosch) on 2012-07-11T09:20:21.000+0000
This is my mistake! :( Thanks to Martin!
Posted by Adam Lundrigan (adamlundrigan) on 2012-07-31T16:24:35.000+0000
Tests updated. Thanks, Martin!
trunk: r25029 release-1.12: r25030