Error messages must also be decorated. Try:
->setDecorators(array(
array('ViewHelper', array('helper' => 'formCheckbox')),
array('Label', array('tag' => 'dt', 'placement' => 'APPEND')),
'Error'
))
--
Hector
On Wed, Jan 20, 2010 at 10:03 AM, gelform <[email protected]> wrote:
>
> I have a 'please agree to our terms' checkbox in a form. I'm setting the
> decorator so the checkbox appears before the label, so I can put them on
> the
> same line. However setting the decorator makes my error message not
> display.
> What am I missing? Thanks!
>
> $agree = new Zend_Form_Element_Checkbox('Contact');
> $agree->setLabel('I have read the complete competition rules and agree to
> them')
> ->setRequired(true)
> ->addValidator(new Zend_Validate_Identical('1'))
> ->setDecorators(array(
> array('ViewHelper', array('helper' => 'formCheckbox')),
> array('Label', array('tag' => 'dt', 'placement' => 'APPEND'))
> ))
> ->addErrorMessage('You must agree.');
> --
> View this message in context:
> http://n4.nabble.com/Setting-a-decorator-on-a-checkbox-loses-my-error-message-tp1018612p1018612.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>