-- drews <[EMAIL PROTECTED]> wrote
(on Thursday, 07 February 2008, 06:16 AM -0800):
> Noé Froidevaux-2 wrote:
> > 
> > How can I highlight in red all inputs witch have errors (for example
> > with changing the class when the field have an error)?
> > 
> 
> one possibility would be to go via decorator and add/change the styleclass
> for the label:
> $element->setDecorators(array(
>                                            array('ViewHelper',
> array('helper' => 'formText')),
>                                            array('Label', array('class' =>
> 'error'))
>                                            )
>                                    );

You don't need to re-add the decorators to modify them. :-)

$label = $element->getDecorator('label');
$label->setOption('class', 'error');

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

Reply via email to