Re: need to create a select element with duplicate values

From: Date: Mon, 10 Apr 2006 23:21:30 +0000
Subject: Re: need to create a select element with duplicate values
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23618@lists.php.net to get a copy of this message
On 4/10/06, michael geary <listmail@gearyweb.com> wrote: > Hi Folks, > > this should be simple, but i cannot do it with QuickForm. I *simply* > want to produce the following HTML: > > <select name='element_name'> > <option value="">Select One</option> > <option value="">---------</option> > <option value="user1">George Washington</option> > <option value="user43">George Bush</option> > ..... > </select> > > Notice that the first two options have a duplicate (empty) value. The > only way i know of to create a select element with QuickForm is to > pass an associative array to the addElement() call, but i cannot have > duplicate keys in an assoc. array, so i cannot model this with one > array. > > Smarty allows you to use two 1-dimensional arrays to achieve this > result. What can i do for this in QuickForm? > Try using addOption instead (not sure if it will work). -- Justin Patrin

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