Re: multiple selections in list/menu field

From: Date: Sat, 15 Sep 2001 06:53:42 +0000
Subject: Re: multiple selections in list/menu field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67429@lists.php.net to get a copy of this message
I didn't take the time to read your code too thoroughly, but remember to have your select name to be anything with "[]" at the end of it, from the look of your name field you have something inside the [], you need to get rid of the rec_pd4 and just call it "x[]" or whatever you would like to call it as long as the "[]" is empty :) I hope that made sense! Rick > From: Tom Beidler <tom@orbittechservices.com> > Date: Fri, 14 Sep 2001 17:26:50 -0700 > To: php list <php-general@lists.php.net> > Subject: [PHP] multiple selections in list/menu field > > I'm trying to use a list/menu field with multiple options allowed but I'm > only getting the very last selection. > > Here's part of my code to build the list/menu field; > > print (" <td><select name=\"x[rec_pd4]\" multiple > size=\"15\">\n"); > print ("$option_pd4"); > print (" </select></td>\n"); > > Here's the code to build the options; > > $pd4arry = array(array("c1,","Bookpacks & > Daypacks"),array("c2,","Mini > Packs/Diaper Bag"),array("c3,","Shoulder Bags/Briefcase")); > foreach($pd4arry as $value) { > > if (($value[0] == $category_code) || ($value[0] == $x[rec_pd4])) { > $option_pd4 .= " <option > value=\"$value[0]\"selected>$value[1]</option>\n"; > } else { > $option_pd4 .= " <option > value=\"$value[0]\">$value[1]</option>\n"; > } > } > > The field displays fine but I only get the last option. I'm testing with IE > 5. > > Let me know if this is not a PHP issue but I thought there might be > something that would prevent me from using this type of field with PHP. > > Thanks, > Tom > > > -- > 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 (#67429) next »