RE: [PEAR] QF - Hierselect and associative arrays

From: Date: Mon, 23 Jan 2006 16:09:25 +0000
Subject: RE: [PEAR] QF - Hierselect and associative arrays
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22643@lists.php.net to get a copy of this message
That's an interesting idea, thanks. _____ From: Adi [mailto:adiszakacs@gmail.com] Sent: Friday, January 20, 2006 8:05 PM To: Mark Steudel Cc: pear-general@lists.php.net Subject: Re: [PEAR] QF - Hierselect and associative arrays You could define globals that represent the equivalent ids for the 'friendly names' of the selected values...this way you never have to dig through your code if anything changes, it will all be kept in one place.....could be a separate include or something... adam On 1/20/06, Mark Steudel <mark@netriver.net> wrote: Is it possible to use associated arrays instead of regular arrays for hierselects? Im trying to get the name of the select element like: <input type="select" name="member[numberofmembers]"> instead of <input type="select" name="member[0]"> I tried: $membershiptype['membershiptype'] = array( 'individual' => 'Individual Plan', 'family' => 'Family Plan', 'corporate' => 'Corporate Plan' ); $additional['numberofmembers'] = array( 'family' => array( '1', '2', '3', '4', '5' ), 'corporate' => array( '1', '2', '3', '4', '5', '6', '7', '8' ) ); $form = new HTML_QuickForm; $sel =& $form->addElement('hierselect','member', 'Choose Plan: ', 'aidditional members'); $options['member'] = array( $membershiptype['membershiptype'], $additional['numberofmembers'] ); $sel->setOptions($options['member']); $form->display(); Anyway may not be possible, thanks Mark -- Take care... Adam

« previous php.pear.general (#22643) next »