...

View Full Version : Form Menu help



huntherr
01-24-2005, 05:20 PM
I have a form menu as shown below:

<select name="final" size="1" id="final">
<option>WIN</option>
<option>TIE</option>
<option>LOSS</option>
</select>

the choice selected is displayed on another page

How do you make the displayed choice font color green for win, red for loss, and blue for tie?? thanks

nite1x
01-24-2005, 07:22 PM
You can use CSS to change the color of the font for the selections.

Just put this in the head of your document
<style type="text/css">
<!--
option.win { color: green; }
option.loss { color: red; }
option.tie { color: blue; }
-->
</style>
and replace the code for the selction menu in the body with this
<select name="final" size="1" id="final">
<option class="win">WIN</option>
<option class="tie">TIE</option>
<option class="loss">LOSS</option>
</select>


Hope this heps.

Nite

huntherr
01-24-2005, 11:02 PM
that changes the color of the form, not what is displayed that is choosen

What is selected is stored into a mysql database, then retrieved

need to know how to change the color of that what is retrieved, something like an if else statement

confusing, but i know it can be down

this is what it looks like the page with what was choosen looks like:



<?
include("config.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM matches ORDER BY id DESC LIMIT 0, 999";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();
?>
<table width="390" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="390"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Date</strong></font></td>
<td width="390"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Opponent</strong></font></td>
<td width="390"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>League</strong></font></td>
<td width="390"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Map</strong></font></td>
<td width="390"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Score</strong></font></td>
<td width="390"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Result</strong></font></td>
</tr>
<?
$i=0;
while ($i < $num) {
$matchdate=mysql_result($result,$i,"matchdate");
$opponent=mysql_result($result,$i,"opponent");
$league=mysql_result($result,$i,"league");
$map=mysql_result($result,$i,"map");
$score=mysql_result($result,$i,"score");
$final=mysql_result($result,$i,"final");

?>
<tr>
<td width="390"><font size="2" face="Times New Roman, Times, serif"><? echo "$matchdate"?></font></td>
<td width="390"><font size="2" face="Times New Roman, Times, serif"><? echo "$opponent"?></font></td>
<td width="390"><font size="2" face="Times New Roman, Times, serif"><? echo "$league"?></font></td>
<td width="390"><font size="2" face="Times New Roman, Times, serif"><? echo "$map"?></font></td>
<td width="390"><font size="2" face="Times New Roman, Times, serif"><? echo "$score"?></font></td>
<td width="390"><font size="2" face="Times New Roman, Times, serif"><b><? echo "$final"?></b></font></td>
</tr>
<?
++$i;
}
echo "</table>";


?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum