Capturing select values from a multliple-select list box
| From: | kimbjork at infoaxis dot com | Date: | Mon, 22 Oct 2001 17:46:05 +0000 |
| Subject: | Capturing select values from a multliple-select list box | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13610@lists.php.net to get a copy of this message | ||
I have this bit of code where I am presenting the user a mulitiple-select
dropdown box in a form as shown below:
<select NAME="county" SIZE=5 MULTIPLE>
<?php
// get county list
$query = "SELECT cid, county FROM allcounties";
$result = mysql_query($query, $connection) or die ("Error in query:
$query. " . mysql_error());
while (list($cid, $county) = mysql_fetch_array($result))
{
echo "<option value=$cid>$county</option>";
}
?>
</select>
My newbie question is, "How can I capture the values associated with the
users' selections from the 'county' box?" Besides wanting to save these
values to another table, I would like to do other things with the
selections prior to completing the processing of this form.
Thanks,
Kim Bjork
www.infoaxis.com