Re: Re: dropdown box displays empty rule

From: Date: Sat, 14 Aug 2004 20:03:45 +0000
Subject: Re: Re: dropdown box displays empty rule
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-193829@lists.php.net to get a copy of this message
Kim, It worked! Thanks, Frank "Kim Steinhaug" <kim@steinhaug.com> wrote in message news:20040814151525.47721.qmail@pb1.pair.com... > 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 > ------------------------------------------------------------------------- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#193829) next »