revert - Re Init() Zend Form after removing some Zend Form Elements -
how can reinitialize created zend form element object had of it's elements remove?
$form = new my_header() //my_header class extends zend_form $form->removeelement('id'); $form->removeelement('first_name');
and after lines need $form
have these fields added back.
at simple level, try storing elements , adding them later. lose placement of form elements, can replace them if you'd too.
example code time:
$form = new my_header(); $storedelements = array(); $storedelements[] = $form->getelement('id'); $form->removeelement('id'); $storedelements[] = $form->getelement('first_name'); $form->removeelement('first_name'); // other stuff here... // add foreach ($storedelements $element) { $form->addelement($element); }
hope helps.
Comments
Post a Comment