RE: [PEAR] need to create a select element with duplicate values
| From: | Mark Steudel | Date: | Tue, 11 Apr 2006 00:46:48 +0000 |
| Subject: | RE: [PEAR] need to create a select element with duplicate values | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23619@lists.php.net to get a copy of this message | ||
This isn't exactly what you want, but something I do is give the
placeholders a value like NONE, or NONE1, then you could loop through the
post data and make sure that the keys don't contain your keyword
e.g.
foreach( $_POST as $key => $value )
{
if( stristr ( 'NONE', $key ) )
{
unset( $_POST[$key] );
}
}
processData();
Just another angle ...
-----Original Message-----
From: michael geary [mailto:listmail@gearyweb.com]
Sent: Monday, April 10, 2006 3:43 PM
To: pear-general@lists.php.net
Subject: [PEAR] need to create a select element with duplicate values
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?
Thanks!!!
-michael geary
--
PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php