phpoptimizer wrote:
> 
> How to add a 'class' attribute to Zend_Form_Element_Submit element? It
> doesn’t recognize it whatever way I tried:
> 
>         $this->addElement(
>             'Submit',
>             'btn_search',
>             array(
>                 'label' => 'Search',
>                 'decorators' => $this->buttonDecorators,
>                 ‘class’ => ‘class_name’
>             )
>         );
> 
> or
>       $this->getElement(‘btn_search’)->setAttrib('class', 'class_name');
> 
> 

Are you sure everything is fine with your decorators? Because i tried your
first piece of code without decorators:

this->addElement('Submit', 'btn_search', array('label' => 'Search', 'class'
=> 'class_name'));

and it works fine.

Good luck,
Dmitry.
-- 
View this message in context: 
http://www.nabble.com/Zend_Form_Element_Submit-class-attribute-tp24418615p24442086.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to