Reputation: 88197
I am trying to add CSS Class & inline style to a form element's/decorator. I tried
$this->addElement('text', 'honeypot', array(
...
'decorators' => array(
'ViewHelper',
'Label',
array('HtmlTag', array('tag' => 'p', 'class' => 'honeypot', 'style' => 'display: none'))
)
));
But the <p>
didn't have the class
& style
attributes attached
Upvotes: 1
Views: 1586
Reputation: 164795
Works fine for me. Are you resetting the element decorators later on using Zend_Form::setElementDecorators()
or something similar?
FYI, you should probably have a semi-colon after your inline style rule, eg
'style' => 'display: none;'
Upvotes: 1