Multiselect tranfer in zend
- by niriza
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');