ZF-6426: Radio button getting invalid XHTML label

Issue Type: Bug Created: 2009-04-25T22:52:40.000+0000 Last Updated: 2009-11-12T04:33:12.000+0000 Status: Resolved Fix version(s): - 1.9.5 (27/Oct/09)

Reporter: Roded Konforty (macpire) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

  • Zend_Form

Related issues: Attachments: - FormLabel.php


when providing label for the radio buttons an invalid xhtml is created because there is no ID associated with the label form.

Results now:

buggy 01 Should be:

buggy 01


Posted by Dennis Day (dennisatddddesigns) on 2009-09-08T12:25:17.000+0000

Here is a corrected version by Dennis Day

Posted by Dennis Day (dennisatddddesigns) on 2009-09-08T12:27:23.000+0000

I have attached a revised version of FormLabel.php for testing and review.

Posted by Matthew Weier O'Phinney (matthew) on 2009-10-15T08:20:31.000+0000

The patch as provided will not work, as it makes the invalid assumption that the form is assigned to the view as the variable "form".

A better approach would be to modify the FormLabel view helper to allow suppression of the "for" attribute via an options flag, and passing that option from the decorator.

Posted by Matthew Weier O'Phinney (matthew) on 2009-10-15T08:56:59.000+0000

Resolved in trunk and 1.9 release branch.

FormLabel view helper now has a "disableFor" option. If enabled, no "for" attribute will be created. Zend_Form_Element_FormRadio now sets this option by default.

Posted by Dennis Day (dennisatddddesigns) on 2009-10-16T06:17:14.000+0000

Oops. I tried.

Posted by Ernest Szulikowski (est) on 2009-11-12T04:33:11.000+0000

This fix created another bug:

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.