A bit of noob question re: font colors in a drop down lis

Hi,

The following piece of code is creating a list box of dates. The field u.fittest contains a color (eg. #CC0000) and I want the font color of each entry in the list to be that of the value in u.fittest. Can someone help me with this?

Thanks in advance for any help.

[code] <?
$sql=“SELECT DISTINCT w.date, u.fittest from #__jform_workout w,#__jform_userworkout u where w.userid=u.id and u.user=”.$_POST[‘user’]." order by w.date “;
$database->setQuery($sql);
$objW=$database->loadObjectList();
if($objW)
{
foreach($objW as $obj)
{
if($_POST[‘date’]==$obj->date)
echo (”".date(‘d-M-Y’,strtotime($obj->date))." “);
else
echo (”".date(‘d-M-Y’,strtotime($obj->date))." ");

           }
        }
     
     ?>[/code]

I believe you will need to use style sheets to adjust the color for an “OPTION” tag as it’s not a standard (html) property of the tag.

That being said, just echo the value from the database of u.fittest in the appropriate style tag.

What style tag you need, I don’t know… Have to look that one further on google.

Sponsor our Newsletter | Privacy Policy | Terms of Service