Re: hierselect.php
| From: | Bertrand Mansion | Date: | Wed, 06 Aug 2003 07:46:12 +0000 |
| Subject: | Re: hierselect.php | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7043@lists.php.net to get a copy of this message | ||
<keith@midnighthax.com> wrote :
> In the example at the head of the code for hierselect.php it says:
>
> * Ex:
> * $form->setDefaults(array('test' => array('4','15')));
> * $sel =& $form->addElement('hierselect', 'test', 'Test:',
> null, '/');
> * $mainOptions = $db->getAssoc('select pkparent, par_desc from
> parent'); * $sel->setMainOptions($mainOptions);
> *
> * $result = $db->query("select fk_parent, pkchild, chi_desc from
> child"); * while ($result->fetchInto($row)) {
> * $secOptions[$row[0]][$row[1]] = $row[2];
> * }
> * $sel->setSecOptions($secOptions);
>
> What are the defaults, 4 and 15, setting? I've tried this example, and
> it works but changing the 4 and 15 to other values makes no discernible
> difference.
They are just here to show how to set defaults for this element. The values
could be anything else you need.
Bertrand Mansion
Mamasam