RE: [PHP-WIN] Handling Multi-Select form lists

From: Date: Tue, 16 Jul 2002 19:20:51 +0000
Subject: RE: [PHP-WIN] Handling Multi-Select form lists
Groups: php.windows 
Request: Send a blank email to php-windows+get-14800@lists.php.net to get a copy of this message
This is the correct form: <select multiple type="select" name="choices[]"> <option value="1">Option 1</option> <option value="2">Option 2</option> </select> When the above is submited, $_POST['choices'] will be an array that contains the selected options. If you have register_globals = On in your php.ini, $choices will also be an array of selected options. > -----Original Message----- > From: Dash McElroy [mailto:Dash@westonefcu.org] > Sent: Tuesday, July 16, 2002 11:30 AM > To: 'ronherhuth@mindspring.com'; php-windows@lists.php.net > Subject: RE: [PHP-WIN] Handling Multi-Select form lists > > > I have a field like this as well. I believe you have to make > the variable name with brackets at the end like this: > > <input type=multiple (or however that works) > name=multi_select[] blah blah> > > That seems to do the trick. It'll make the variable > multi_select an array (obviously). > > -Dash > > -----Original Message----- > From: R.S. Herhuth [mailto:ronherhuth@pop.mindspring.com] > Sent: Tuesday, July 16, 2002 11:30 AM > To: php-windows@lists.php.net > Subject: [PHP-WIN] Handling Multi-Select form lists > > > > I am using a multi-select form list...how do I go about > retrieving the multiple values? My current script only pulls > the first value using: > > $_POST['multi_select']; > > Thanks, > Ron > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.windows (#14800) next »