Re: pre-selecting from a <option> list
| From: | Marek Kilimajer | Date: | Fri, 23 May 2003 11:09:29 +0000 |
| Subject: | Re: pre-selecting from a <option> list | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148756@lists.php.net to get a copy of this message | ||
This is how it is usualy done:
while( $option = get_option()) {
echo '<option value="'.$option['value'].'"'.($_GET['some_var'] == $option['value'] ? ' selected' : ''). '>'.$option['name'].'</option>';
}
George Pitcher wrote:
Hi, I'm building a website and want to show a list of status messages. These messages relate to the current status of an object on another website (no connection possible - its my own site). I want the user to be able to see the last selected option whenever the list is displayed. On a short list, I've done it by using multiple versions of the list depending on conditions but this status list has more than 30 status levels (it refers to a long and complicated workflow). The website is being built around MS Access (their choice). Any suggestions? Cheers George === George Pitcher HERON Technical Manager Ingenta plc 23-38 Hythe Bridge Street, Oxford, OX1 2ET T +44 (0)1865 799051 direct T +44 (0)1865 799000 switchboard F +44 (0)1865 799134 E george.pitcher@ingenta.com www.ingenta.com Ingenta: Empowering the exchange of academic and professional content online.