Re: QuickForm hierselect muiltiple choice problem
| From: | Joshua Eichorn | Date: | Thu, 03 Jun 2004 00:07:22 +0000 |
| Subject: | Re: QuickForm hierselect muiltiple choice problem | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12848@lists.php.net to get a copy of this message | ||
Helder Miguel Rodrigues wrote:
Alexey Borzov wrote:You'll want to do: $hsfilerelatorioperm = &$form->addElement('hierselect', 'filerelatorioperm', array('Relatório:')); $hsfilerelatorioperm->setMainOptions($perms); $hsfilerelatorioperm->setSecOptions(array(array(), array(), array(), array(), $clientsInternet, $clientsInstitucional)); $els =& $hsfilerelatorioperm->getElements(); $els[1]->updateAttributes(array('multiple' => 'multiple','size'=>6)); You'll also need to update the swapOptions method since setting it to multiple will change the name of the element and make it fail with a js error. I posted my updated method for this a couple posts ago, you'll need to update it a bit since in my case each element is a multiple.Hi! Helder Miguel Rodrigues wrote:It didnt work! :( Any another suggestion? Another type of implementation? Thanks$foo =& $form->addElement('hierselect', ...); $els =& $foo->getElements(); $els[1]->updateAttributes(array('size' => 6, 'multiple' => 'multiple')); I didn't test this, but it *may* work...I dont understand how can i do that?There is any solution to be possible to have multiple selections in the second select?I think you set the 'multiple' attribute for both selects this way. Get the hierselect's elements by using getElements() and update the attributes only of the second one.
The line to look at is: ." ctl = frm.form[grpName+'['+i+'][]'];\n"-josh