i *think* you can do something like <select name="county[]"> and then it
will pass an array on submission (someone please correct if wrong!) failing
that, you could use a javascript:onChange() function to set the value of a
hidden field using something like (snippet from previous project)
function updateValueString() {
var newValueString = "";
for ( i = 0; i < document.query.include_list.length; i++ ) {
newValueString += "|" +
document.query.include_list[i].value;
}
document.query.include.value = newValueString;
}
then on the next page, ignore the value submitted from the actual select,
and just work with the value submitted by the hidden field.
HTH
/beau
// -----Original Message-----
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 23 October 2001 1:46 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Capturing select values from a
// multliple-select list
// box
//
//
// 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
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail:
// [EMAIL PROTECTED]
//
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]