php - How to show hide a textbox with label in zend framework? -
i have element in zend form
$item1 = $this->createelement('text','item1'); $item1->setlabel('enter item 1:') ->setrequired(true) ->setattrib('class','hide_textbox');
here hide_textbox
class in css file makes display none . it's hiding text box not label, want hide textbox label,(i don't want use removedecorator('label')
) later want show label , textbox using javascript
add class 1 of wrapper decorators.
the specifics of entirely depend on decorator scheme. not done using standard decorators label , element inside different wrappers (<dt>
, <dd>
respectively).
here's quick example assumes rest of form decorated not use definition lists...
$item1->setdecorators(array( 'viewhelper', 'errors', 'label', array('htmltag', array('tag' => 'div', 'class' => 'hide_textbox', 'id' => 'item1-wrapper')) ));
Comments
Post a Comment