to select or not to select...

From: Date: Tue, 31 Oct 2000 04:16:10 +0000
Subject: to select or not to select...
Groups: php.general 
Request: Send a blank email to php-general+get-22852@lists.php.net to get a copy of this message
Hey all, Can an anyone suggest a better way to do the the following? <select name="foo"> <?php if ( $sel == "bar" ) { ?> <option value="bar" selected>bar</option> <?php } else { ?> <option value="bar">bar</option> <?php } ?> As you can see I am choosing what option is selected in a list/menu the above example works fine until you have lots of options then it is a nightmare, I have tried a few things to no avail does anyone know a cleaner/simpler way of doing this? Any suggestions would be great, Regards, Joseph -- BoldFX / Binary Logic 750 Port Road Beverley 5009 Ph: (08) 8244 1800 Fax: (08) 8244 1811 mailto: joseph.blythe@binarylogic.com.au

« previous php.general (#22852) next »