I am creating a page that the user can choose their background color by clicking a color button on the form. For some reason I can not get my buttons to work. Any suggestions? Please help
<SCRIPT LANGUAGE="JavaScript1.2">
//HIDE FORM INCOMPATIBLE BROWSERS
var green_change = "green";
var yellow_change = "yellow";
var red_change= "red";
function changeColor() {
if (document.colors.red_name==true){
document.bgColor="red";
}
else if (document.colors.yellow_name==true){
document.bgColor="yellow";
}
else if (document.colors.blue_name==true){
document.bgColor="blue";
}
}
</SCRIPT>
</head>
<body>
<form name="colors" action="" method="get">
<INPUT TYPE="BUTTON" VALUE="RED" NAME="red_name"onClick="changeColor()">
<INPUT TYPE="BUTTON" VALUE="YELLOW" NAME="yellow_name" onClick="changeColor()">
<INPUT TYPE="BUTTON" VALUE="BLUE" NAME="blue_name" onClick="changeColor()">
</form>
</body>
<SCRIPT LANGUAGE="JavaScript1.2">
//HIDE FORM INCOMPATIBLE BROWSERS
var green_change = "green";
var yellow_change = "yellow";
var red_change= "red";
function changeColor() {
if (document.colors.red_name==true){
document.bgColor="red";
}
else if (document.colors.yellow_name==true){
document.bgColor="yellow";
}
else if (document.colors.blue_name==true){
document.bgColor="blue";
}
}
</SCRIPT>
</head>
<body>
<form name="colors" action="" method="get">
<INPUT TYPE="BUTTON" VALUE="RED" NAME="red_name"onClick="changeColor()">
<INPUT TYPE="BUTTON" VALUE="YELLOW" NAME="yellow_name" onClick="changeColor()">
<INPUT TYPE="BUTTON" VALUE="BLUE" NAME="blue_name" onClick="changeColor()">
</form>
</body>