
June 30th, 2003, 09:27 PM
|
|
Junior Member
|
|
Join Date: Jun 2003
Posts: 22
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
changing css style color with switch
Ok, this should be easy for you guys here.
This is what I'm trying to do :
-create a recursive page
-page contains 3 radio buttons
-buttons allow for choice between colors: green, blue, red.
-default choice is green font color (css style)
-form should remember the selected choice (the rest of the page performs some addition problems)
-can't use cookies only the switch function to change the font color (css style)
-no external css files
Here's what I have. I know I'm making some mistakes, just don't know how to fix them.
Thank you.
-----------------
The second part of my question is of low priority :
What's the best text editor to use for the Mac? I was using BBEDIT and began to see some weird characters on some servers.
Are there any text editors that color the text (different colors for diff. attributes) and also show line#'s (for the mac osx?)
-----------------clipping starts here----------------
<html>
<head>
<title></title>
<body style="font-family:Arial, Helvetica, sans-serif; color: green;">
</table>
<tr>
<td>
<form name="stylecolor" method=POST" action asgn_2j.php">
Green
<input type="radio" name="style" value="green">
Blue
<input type="radio" name="style" value="blue">
Red
<input type="radio" name="style" value="red">
<INPUT TYPE=HIDDEN NAME=stylecolor VALUE=true>
<INPUT TYPE=submit NAME="SUBMIT" VALUE="Submit">
<?
$stylecolor=$HTTP_POST_VARS['stylecolor'];
switch($stylecolor)
{
case 'green
echo '(<body style="font-family:Arial, Helvetica, sans-serif; color: green;">)' ;
case 'blue'
echo '(<body style="font-family:Arial, Helvetica, sans-serif; color: blue;">)' ;
case 'red'
echo '(<body style="font-family:Arial, Helvetica, sans-serif; color: red;">)' ;
default:
echo 'you didn't choose' ;
break;
}
?>
</form>
</td>
</tr>
</table>
</body>
</html>
|