Zend Framework

Values in Zend_View_Helper_FormCheckbox - Unexpected Functionality

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0.0
  • Fix Version/s: 1.0.3
  • Component/s: Zend_View
  • Labels:
    None
  • Fix Version Priority:
    Should Have

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"  /> 

Activity

Hide
Darby Felton added a comment -

Assigning to Matthew Weier O'Phinney to initiate issue review.

Show
Darby Felton added a comment - Assigning to Matthew Weier O'Phinney to initiate issue review.
Hide
Matthew Weier O'Phinney added a comment -

Scheduled for 1.0.3 release

Show
Matthew Weier O'Phinney added a comment - Scheduled for 1.0.3 release
Hide
Matthew Weier O'Phinney added a comment -

This was rolled back 11 July 2007, and has been available since the 1.0.1 release.

Show
Matthew Weier O'Phinney added a comment - This was rolled back 11 July 2007, and has been available since the 1.0.1 release.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified