RE: [PEAR] Quickform select array

From: Date: Tue, 17 Jun 2003 14:17:46 +0000
Subject: RE: [PEAR] Quickform select array
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6043@lists.php.net to get a copy of this message
> -----Original Message----- > From: Alexey Borzov [mailto:borz_off@cs.msu.su] > > Mike Carter wrote: > > Hi, > > > > When using the Quickform 'select' element it would be nice if there > > was an option To make it automatically take the array > values and use > > them for both the option label AND the option value in the HTML it > > outputs. > > If I understood you correctly, you want to use an array like > array('A', > 'B', 'C') and to receive in output > <option value="A">A</option> > <option value="B">B</option> > <option value="C">C</option> > > You can easily process your array like this: > > foreach ($ary as $item) { > $aryAssoc[$item] = $item; > } > > and pass the resultant $aryAssoc to addElement(), no need to > add special > logic to HTML_QuickForm_select. Yup that is my current method of getting around the situation. If there's nothing in Quickform I'll leave it at that. Thanks for your time Alexey. - Mike C. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 6/10/2003 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

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