Jump to content

[SOLVED] A bit of noob question re: font colors in a drop down list


BigMal

Recommended Posts

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.

 

 

<?

$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 ("<option value='".$obj->date."' selected>".date('d-M-Y',strtotime($obj->date))." </option>");

else

echo ("<option value='".$obj->date."' >".date('d-M-Y',strtotime($obj->date))." </option>");

 

}

}

 

?>

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.