Re: Remembering which option in a SELECT tag the user had chosen
| From: | Webapprentice | Date: | Wed, 29 Jan 2003 17:18:54 +0000 |
| Subject: | Re: Remembering which option in a SELECT tag the user had chosen | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133530@lists.php.net to get a copy of this message | ||
Hi John,
I was thinking of inserting a check on each option, but I thought there had to be a different way.
I've received ideas of storing the option values in an array and creating a function to generate that dropdown by grabbing values out of the array, so I want to go with that because that is more elegant, which what I was after.
Thanks!
--Stephen
Unless you come up with a nice function to create this box for you, then the only way is to go in on each line, in each <option> tag and check $_POST['TimeChoice'] (or $_GET, $_REQUEST, whatever...) to see if it equals the current value. <option value="Friday August 22, 04:00 PM - 06:00 PM"<? if($_POST['TimeChoice']=="Friday August 22, 04:00 PM - 06:00 PM") { echo " SELECTED"; }?>>Friday August 22, 04:00 PM - 06:00 PM</option> ---John Holmes...