Jump to content

php + list boxes + hilighting


eva21

Recommended Posts

php function:

function Hilight($val1, $val2){

$return = "";

if($val1 == $val2){

$return = " style='background-color:blue'";

}

return($return);

}

 

php code:

$teach = "cat";

echo("<option value='cat'><font " . Hilight("cat",$teach) . ">

cat

</font></option>");

 

This code should make cat hilighted with blue so why does it not work?

Link to comment
https://forums.phpfreaks.com/topic/158746-php-list-boxes-hilighting/
Share on other sites

function Hilight($val1, $val2){

$return = "";

if($val1 == $val2){

$return = " style='color:blue;'";

}

return($return);

}

 

 

echo("<option value='cat'><font" . Hilight("cat",$teach) . ">

cat

</font></option>");

 

...

 

The HTML source that's outputted. (I guess I had this coming to me.)

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.