Date: 10/22/01
- Next message: Jon Farmer: "Re: [PHP-DB] Creating a file using php"
- Previous message: kras: "[PHP-DB] datetime in MSSQL7"
- Maybe in reply to: kimbjork <email protected>: "[PHP-DB] Capturing select values from a multliple-select list box"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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: kimbjork <email protected> [mailto:kimbjork <email protected>]
// Sent: Tuesday, 23 October 2001 1:46 AM
// To: php-db <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: php-db-unsubscribe <email protected>
// For additional commands, e-mail: php-db-help <email protected>
// To contact the list administrators, e-mail:
// php-list-admin <email protected>
//
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jon Farmer: "Re: [PHP-DB] Creating a file using php"
- Previous message: kras: "[PHP-DB] datetime in MSSQL7"
- Maybe in reply to: kimbjork <email protected>: "[PHP-DB] Capturing select values from a multliple-select list box"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

