Re: Retrieving data from multiple select list

From: Date: Sun, 11 Mar 2001 09:05:41 +0000
Subject: Re: Retrieving data from multiple select list
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43376@lists.php.net to get a copy of this message
try this: in the form: <select name="CatecoryID[]" size="3" multiple> <option value="1">Item 1</option> <option value="2">Item 2</option> <option value="3">Item 3</option> </select> in the script: $num = sizeof($CategoryID); // Number of array items for($i=0;$i<$num;$i++) { // $CategoryID[$i] --> whatever you wanna do with it... } "Ben Cheng" <ronin@darwinmail.net> schrieb im Newsbeitrag news:p05010402b6d0b285663b@[10.10.0.169]... > I have a select box that allows the user to select and submit more > than one selection at a time. How do I retrieve all the selections > in PHP? For example, the select list is named CategoryID. But when > I select more than one item and then hit submit, $CategoryID only > shows me the last value of the selected items. How do I see all the > values that have been selected? > > -Ben > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#43376) next »