Quickform select array
| From: | Mike Carter | Date: | Tue, 17 Jun 2003 10:11:22 +0000 |
| Subject: | Quickform select array | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6034@lists.php.net to get a copy of this message | ||
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.
It would make it much simpler if I define a comma seperated list and
explode() this into an array to pass straight to the addElement() method:-
$form->addElement('select', 'title', $language['L_Title'],
explode(',', '
,'.$language['L_Titles']));
Maybe there is a hidden option to do this with the element already? I
realise an associative array is the answer - but is there a way to auto
generate one (ie copy the value to the key for each array element, on the
fly) ?
Regards,
--
Mike Carter [web developer]
tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com
This message is confidential.
Unless you are the named addressee or their delegated representative you may
not use, disclose, or copy the contents of the e-mail. If you are not the
named addressee please notify the sender immediately and delete the material
from your computer. Any views or opinions contained in this e-mail are
solely those of the author unless expressly stated otherwise
---
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
________________________________________________________________________