I want to change background color of selected option item in php but i coulnd do that. I only add an indicator(*) to begining of the selected option with bellow code but i am not exactly need that. I need to change text color of selected form item in php.
Adding style="background-color:red" to $a is works.!
<select name="dest">
<?php
$a='';
$sql2 = "select evaperiod from evaluationperiod";
$query2 = mysql_query($sql2);
if(mysql_num_rows($query2)>0)
{
$x='20';
$guncel='';
while($result=mysql_fetch_array($query2))
{
$period = $result['evaperiod'];
if($period==$donemm)
$a=" selected='selected' style='background-color:red'";
if($period==$periodd)
$guncel='*';
else
$a='';
print "<option value='$period'$a>$guncel$x$period</option>";
$guncel='';
}
} ?>
</select>