Details
Description
Changes made in reference to http://framework.zend.com/issues/browse/ZF-1568 alter the expected functionality of Zend_View_Helper_FormCheckbox and break backwards compatibility.
Documented functionality states that the first option in $options is the default checked value. However, if $value is set and the checkbox should not checked by default ($value != $option[0]), two form fields (1 hidden, 1 checkbox) are returned with the value of $value, making it impossible to get the default checked value ($option[0]) returned from the form.
echo $this->formCheckbox('opt_in', 'no', null, array('yes', 'no'));
Produces:
<input type="hidden" name="opt_in" value="no" />
<input type="checkbox" name="opt_in" id="opt_in" value="no" />
Expected:
<input type="hidden" name="opt_in" value="no" />
<input type="checkbox" name="opt_in" id="opt_in" value="yes" />
Assigning to
Matthew Weier O'Phinney to initiate issue review.