I was playing around with Zend_Form a little while ago and I realized they did something neat with checkboxes.
Everytime I created a checkbox, Zend made two.
<input id="optInDefault" name="optIn" type="hidden" value="n" />
<input id="optIn" name="optIn" type="checkbox" value="y" />
One hidden, and one not. This is handy because when the user doesn’t check it – the hidden value gets posted. When the checkbox is selected, that value overrides the hidden one.
This also works for radio buttons, or any other form element where you want a default value posted.






