Zendform not validating
$newsletter Optin = new Zend_Form_Element_Checkbox( 'newsletter Optin' ); $newsletter Optin- Hey Mon, Thanks again for the response. ;-) But are you suggesting that this is a workaround because I overwrote the decorators?Would you mind elaborating on your suggestion about using decorators the usual way?Lastly, the controller is essentially identical to what we did in the Simple Zend_Form Example: , so you can see what it looks like: As you can see, although Zend Framework 1.5 doesn't have file upload element built in, adding one is not especially hard.
It seems to populate a default value of "0" in the hidden element (which I think is correct) but also in the checkbox input element as well.
I'm building on the Simple Zend_Form Example, so make sure you have read that and that it works before you start this one.
This is what the form looks like: (Unstyled, as usual!
The file element also has some helper functions ( where we set $error to the 'error' value originally from the $_FILES array and then set our error message based on which error PHP has reported to us.
If PHP reported no error (UPLOAD_ERR_OK), then we return true, otherwise we return false after having set the error value.