ZF-10661: Zend_View_Helper_FormSelect should not render label attribute


I've been wondering for a time why the label attribute gets rendered on option tags in a select tag. Diving into some html sources it looks like only IE 6+ implements it, but does nothing with it:

Sources: - http://msdn.microsoft.com/en-us/library/ms533932(v=vs.85).aspx - http://www.w3schools.com/tags/att_option_label.asp

So, to me it looks like a waste of performance and bandwidth to render it at all. I think that if it would be removed, nobody will miss it. Though it could of course be made optional (via passing in a pseudo attribute?)


The HTML standard says: {quote}label = text [CS] This attribute allows authors to specify a shorter label for an option than the content of the OPTION element. When specified, user agents should use the value of this attribute rather than the content of the OPTION element as the option label.{quote} http://w3.org/TR/html4/…

We have no options for a shorter label. At the moment the label is used for the label attribute and as content for the option element. Conclusion: We can remove the label attribute.

Patch and unit test added.

Fix: "\n" to {{PHP_EOL}}

Fixed on trunk (25186) and release-1.12 (25187)