Re: Conditional default value of drop-down list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



see below

Jason End wrote:

> How could I make the default value of the list be
> conditional on the categories id? So if the variable
> categories id is "3",

$listdefault[3]="selected";

echo "<select count=\"1\" name=\"categories\">\n";

// walk through list of categories somehow,
// in this case, an array called $catlist

for ($i=1; $i<=count($catlist);$i++) {
   echo " <option value=\"$i\" $listdefault[$i]>$catlist[$i]</option>\n";
}

echo "</select>\n";

> the initial value shown in that
> drop down menu will be the description of the category
> with id 3.
> Does this make sense?
>
> thanks,
>
> J
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux