Re: Sending selected value of <select> to another script.

From: Date: Sun, 10 Dec 2000 03:47:22 +0000
Subject: Re: Sending selected value of <select> to another script.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29494@lists.php.net to get a copy of this message
It's OK guys! I did not supply the right name in the associated hidden field. malco ----- Original Message ----- From: "Malcolm Clark" <mal@sawds.com> To: <php-general@lists.php.net> Sent: Saturday, December 09, 2000 4:12 PM Subject: [PHP] Sending selected value of <select> to another script. > I can get values from txt fields to be passed over to another php script on > Submit, but passing over the value of a selected item from a single-choice > drop down menu is eluding me :( As it stands it passes over a false/ zero > value, when it should be an integer >= 1. > > Why is '$newcat' not passed over to the script specified in <form> on Submit > ? > > > while ($row2 = mysql_fetch_array($result)) { > > $newcat = $row2[category_id]; > if ($category_id == $newcat) { > > $drop_down .= " <option value=\"$newcat\" > selected>$row2[category]</option>\n"; > > } else { > > $drop_down .= " <option > value=\"$newcat\">$row2[category]</option>\n"; > > } > > } > > > ...later in <body> > > <select name="Category"> > <? echo "$drop_down" ?> > </select> > > > TIA > > > malco > > > -- > 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 (#29494) next »