Re: dropdown box displays empty rule
| From: | Kim Steinhaug | Date: | Sat, 14 Aug 2004 15:17:54 +0000 |
| Subject: | Re: dropdown box displays empty rule | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193802@lists.php.net to get a copy of this message | ||
Well, seems you have some confusing logic here, since you
print out the option before you check if it should be checked.
To top it off, when its accually checked you write out an empty
value, which really doesnt make any sence at all.
A quick rewite would be :
while($rowu=mysql_fetch_object($result1)){
if ($selected==$rowu->naamreis)
echo "<option SELECTED value=\"$rowu->naamreis\">" .
$rowu->naamreis .
"</option>\n" ;
else
echo "<option value=\"$rowu->naamreis\">" .
$rowu->naamreis . "</option>\n" ;
}
--
Kim Steinhaug
-------------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-------------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.easycms.no - www.webkitpro.com
-------------------------------------------------------------------------