-- Aldemar Bernal <[EMAIL PROTECTED]> wrote
(on Tuesday, 08 April 2008, 05:47 AM -0500):
> just curious, doesn't Zend_Form create a hidden element with value 0 for the
> checkbox field?

No. The Checkbox element itself is "smart" enough to determine if the
value was set, and will return either the "checkedValue" or
"uncheckedValue" appropriately. 

These values are 1 and 0 by default, respectively, and you can set them
using the keys as specified above, or using their accessors
(setCheckedValue() and setUncheckedValue()). If no value is provided
for the checkbox, the value of the element will be the uncheckedValue;
if the value is the same as the checkedValue, that will be used.

> I just want to skip the:
>  
> $model->checked_value = isset($values['my_checkbox']) ? $values['my_checkbox']
> : 0;

You should be able to skip that. :-)

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to