> From: Nathan Cook [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 2:52 PM > Subject: Re: [PHP] New way to make select boxes auto select
> How are you able to quickly and painlessly determine which > key gets the > selected value, from form submission data, when building the > initial array? Via the selected name, say, $POST['location']. I usually use the db code table method and something like: echo setupSelect($db,"locations","LocName","LocName",$_POST['location']); If you were using hard coded values like Active, Inactive,etc you can just do a: $status = array('Active','Inactive'); $status[$_POST['status']] = 'selected; echo buildSelect($status); It doesn't handle multi selects and it's resulting arrays, but that should be too hard to do by checking if the selected value is an array & modify the comparison in that case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php