Multiselect tranfer in zend

Posted by niriza on Stack Overflow See other posts from Stack Overflow or by niriza
Published on 2011-01-14T07:50:02Z Indexed on 2011/01/14 7:53 UTC
Read the original article Hit count: 189

Filed under:

I want to transfer the selected value of Zend_Form_Element_Multiselect to another multiselect element of zend form. I tried this with JQuery it works but when I try to populate the form I get a problem what should I do in my controller. My code look like this:

Form:

$form['core'] = new Zend_Form_Element_Multiselect('core'); foreach ($results as $row) { $form['core']->addMultiOption($row['id'],$row['competencies']); } $form['core']->setLabel('Core competencies')->setAttrib('id','select1');

$form['core_competency'] = new Zend_Form_Element_Multiselect('core_competency'); foreach ($results as $row) { $form['core_competency']->addMultiOption($row['id'], ''); } $form['core_competency']->setAttrib('id','select2');

$form['subsidiary'] = new Zend_Form_Element_Multiselect('subsidiary'); foreach($results as $row) { $form['subsidiary']->addMultiOption($row['id'],$row['competencies']); } $form['subsidiary']->setLabel('Subsidiary competencies');

$form['subsidiary_competency'] = new Zend_Form_Element_Multiselect('subsidiary_competency'); $form['subsidiary_competency']->addMultiOption('','');

$form['save'] = new Zend_Form_Element_Submit('competencies'); $form['save']->setLabel('Save')->setValue('competencies') ->setAttrib('id','competencies-save');

$this->addElements($form); $this->setMethod('post');

© Stack Overflow or respective owner

Related posts about zend-form