RE: [PHP] Select multiple boxes
| From: | Cal Evans | Date: | Sat, 18 Jan 2003 14:41:05 +0000 |
| Subject: | RE: [PHP] Select multiple boxes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132092@lists.php.net to get a copy of this message | ||
use [] in your select box name. When it comes back in the $_POST array you
will have an array of options. It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.
<SELECT name="mySelect[]" multi >
<option name='1'>Don't pick me</option>
<option name='2'>Pick me</option>
</select>
Selecting both results in:
$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"
HTH,
=C=
*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*
-----Original Message-----
From: Gregory Chagnon [mailto:gregchagnon@hotmail.com]
Sent: Friday, January 17, 2003 11:14 PM
To: php-general@lists.php.net
Subject: [PHP] Select multiple boxes
Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected? Thanks!
-Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php