Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's an issue with jQuery and not the Zend Framework. The wrapping of the element in the label tag is perfectly valid it's just jQuery UI doesn't support it. I have posted a <a href="http://bugs.jqueryui.com/ticket/6063" rel="nofollow">bug report</a>.</p> <p><strong>* Update Answer *</strong></p> <p>However I think what you are trying to do (as you commented) is to use the jQuery UI buttonset, which is what I was doing when I came across the jQuery UI bug. In short you have two options until the bug is fixed:</p> <p>1) Use Dennis D.'s custom view helper to over ride the default radio button element.</p> <p>2) Patch the Zend Framework Radio button view helper with the code Dennis D. has written. It appears in the file Zend_View_Helper_FormRadio on line 169 (Zend framework Version 1.11.0).</p> <p>Firstly create a new label and close the tag</p> <pre><code>// Create the label $label = '&lt;label' . $this-&gt;_htmlAttribs($label_attribs) . ' for="' . $optId . '"&gt;' . (('prepend' == $labelPlacement) ? $opt_label : '') . '&lt;input type="' . $this-&gt;_inputType . '"' . $opt_label . '&lt;/label&gt;'; </code></pre> <p>Secondly alter the code that creates the radio button to:</p> <pre><code>// Create the radio button $radio = '&lt;input type="' . $this-&gt;_inputType . '"' </code></pre> <p>Thirdly remove the closing of the label tag (as you've already done it) in the view helper, change:</p> <pre><code>. $endTag . (('append' == $labelPlacement) ? $opt_label : '') . '&lt;/label&gt;'; </code></pre> <p>And simply replace with:</p> <pre><code>. $endTag; </code></pre> <p>Then combine the radio and the label using the placement positioning:</p> <pre><code>// Combine the label and the radio button if ('prepend' == $labelPlacement) { $radio = $label . $radio; } else { $radio = $radio . $label; } </code></pre> <p>And that's it (again Dennis D has done it in the view helper) but the changed code should look like (starting at line 169:</p> <pre><code>// Create the label $label = '&lt;label' . $this-&gt;_htmlAttribs($label_attribs) . ' for="' . $optId . '"&gt;' . $opt_label . '&lt;/label&gt;'; // Create the radio button $radio = '&lt;input type="' . $this-&gt;_inputType . '"' . ' name="' . $name . '"' . ' id="' . $optId . '"' . ' value="' . $this-&gt;view-&gt;escape($opt_value) . '"' . $checked . $disabled . $this-&gt;_htmlAttribs($attribs) . $endTag; // Combine the label and the radio button if ('prepend' == $labelPlacement) { $radio = $label . $radio; } else { $radio = $radio . $label; } // add to the array of radio buttons $list[] = $radio; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload