I would like to add a simple check box to my form:
$element = new Zend_Form_Element_Checkbox(\'dont\');
$element->setDescription(\'Check this box if you don\\\
The thread is old but none answer is corrent...
I had the same issue, but I have figured it out, so here is the CORRECT answer:
If you don't like your checkbox value posted when it's unchecked and sent some value only when it IS checked - just use this code:
$chk = new Zend_Form_Element_Checkbox('test_checkbox');
$chk->setRequired();
$chk->setUncheckedValue(null);
$chk->setCheckedValue(1);
...
The checked value is 'some_value', BUT when checkbox is unchecked the value is null, so it doesn't validate because 'required' is set. It works for me for now and there is no need to use 'sophisticated' jquery scripts to remove hidden fields, etc.