sparklin
03-04-2003, 05:05 AM
How do I come up with the results and make that button active? Heres what I did so far?
<title>What Season are you?</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function process()
{
var Spring = 0;
var Summer = 0;
var Autumn = 0;
var Winter = 0;
var f = document.f;
var i = 0;
for (i = 0; i < f.one.length; i++) if (f.one[i].checked) value = f.one[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.four.length; i++) if (f.four[i].checked) value = f.four[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.five.length; i++) if (f.five[i].checked) value = f.five[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
var out = "Spring ";
i = Spring ;
if (Spring > i) { out = "Spring "; i = Spring; }
if (Summer > i) { out = "Summer"; i = Summer; }
if (Autumn > i) { out = "Autumn"; i = Autumn; }
if (Winter > i) { out = "Winter"; i = Winter; }
location.href = out + ".html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
<STYLE type="text/css">
<!--A:link{color:hotpink; text-decoration:none;font-weight:normal}-->
<!--A:visited{color:hotpink;text-decoration:none;font-weight:normal}-->
<!--A:active{color:hotpink;text-decoration:none;;background-color:none;font-weight:normal}-->
<!--A:hover{color:white;text-decoration:none;background-color:hotpink;font-weight:normal}-->
<!--body {scrollbar-face-color:#ff1161;
scrollbar-shadow-color:#FF76B6;scrollbar-highlight-color:#DD006C;scrollbar-3dlight-color:#ff2367;scrollbar-darkshadow-color:#BB006A;scrollbar-track-color:#FF76b6;
scrollbar-arrow-color: ffffff;}-->
<!--BODY {
color:white;
font-size:8pt;
font-family:verdana;
background-image: url(YOUR BACKGROUND IMAGE HERE.gif/jpg);
background-attachment : fixed;
line-height: 15px;
}-->
</style>
</head>
<body bgcolor="#ffffff">
<form name="f">
<font color="hotpink"><b>What weather do you feel most comfortable in?</b><br>
<input type="radio" name="one" value="1">70 degrees<br>
<input type="radio" name="one" value="2">90 degrees and above!<br>
<input type="radio" name="one" value="3">60-70 degrees<br>
<input type="radio" name="one" value="4">50 and below<br>
<br><br>
</font>
<font color="hotpink"><b>When its 50 degrees outside you say...</b><br>
<input type="radio" name="two" value="1">This isn't so bad, it could get worst<br>
<input type="radio" name="two" value="2">Ah!Too cold for me!<br>
<input type="radio" name="two" value="3">Not bad at all<br>
<input type="radio" name="two" value="4">So what! I love it!<br>
</font>
<br><br>
<font color="hotpink"><b>When it reaches 100 degrees outside you would...</b><br>
<input type="radio" name="three" value="1">Sit in you air conditioned house<br>
<input type="radio" name="three" value="2">Go take in the sun<br>
<input type="radio" name="three" value="3">Take a cold shower<br>
<input type="radio" name="three" value="4">I hate summer!<br>
</font><br><br>
<font color="hotpink"><b>Your ideal vacation spot during the winter would be...</b><br>
<input type="radio" name="four" value="1">California<br>
<input type="radio" name="four" value="2">Florida<br>
<input type="radio" name="four" value="3">Arizona<br>
<input type="radio" name="four" value="4">New York<br>
</font>
<br><br>
<font color="hotpink"><b>If you had a choice on where you wanted to be during January, what part of the U.S. would you be in?</b><br>
<input type="radio" name="five" value="1">South<br>
<input type="radio" name="five" value="2">West<br>
<input type="radio" name="five" value="3">East<br>
<input type="radio" name="five" value="4">North<br>
<br>
<input type="button" value="What season am I? " onclick="process();" style="font-family:veranda; font-size=8pt; border:1; border-color:hotpink; border-style:solid; background-color:white"><br><br><br>
</body>
</html>
<title>What Season are you?</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function process()
{
var Spring = 0;
var Summer = 0;
var Autumn = 0;
var Winter = 0;
var f = document.f;
var i = 0;
for (i = 0; i < f.one.length; i++) if (f.one[i].checked) value = f.one[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.four.length; i++) if (f.four[i].checked) value = f.four[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
for (i = 0; i < f.five.length; i++) if (f.five[i].checked) value = f.five[i].value;
if (value == "1") { Spring++; }
if (value == "2") { Summer++; }
if (value == "3") { Autumn++; }
if (value == "4") { Winter++; }
var out = "Spring ";
i = Spring ;
if (Spring > i) { out = "Spring "; i = Spring; }
if (Summer > i) { out = "Summer"; i = Summer; }
if (Autumn > i) { out = "Autumn"; i = Autumn; }
if (Winter > i) { out = "Winter"; i = Winter; }
location.href = out + ".html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
<STYLE type="text/css">
<!--A:link{color:hotpink; text-decoration:none;font-weight:normal}-->
<!--A:visited{color:hotpink;text-decoration:none;font-weight:normal}-->
<!--A:active{color:hotpink;text-decoration:none;;background-color:none;font-weight:normal}-->
<!--A:hover{color:white;text-decoration:none;background-color:hotpink;font-weight:normal}-->
<!--body {scrollbar-face-color:#ff1161;
scrollbar-shadow-color:#FF76B6;scrollbar-highlight-color:#DD006C;scrollbar-3dlight-color:#ff2367;scrollbar-darkshadow-color:#BB006A;scrollbar-track-color:#FF76b6;
scrollbar-arrow-color: ffffff;}-->
<!--BODY {
color:white;
font-size:8pt;
font-family:verdana;
background-image: url(YOUR BACKGROUND IMAGE HERE.gif/jpg);
background-attachment : fixed;
line-height: 15px;
}-->
</style>
</head>
<body bgcolor="#ffffff">
<form name="f">
<font color="hotpink"><b>What weather do you feel most comfortable in?</b><br>
<input type="radio" name="one" value="1">70 degrees<br>
<input type="radio" name="one" value="2">90 degrees and above!<br>
<input type="radio" name="one" value="3">60-70 degrees<br>
<input type="radio" name="one" value="4">50 and below<br>
<br><br>
</font>
<font color="hotpink"><b>When its 50 degrees outside you say...</b><br>
<input type="radio" name="two" value="1">This isn't so bad, it could get worst<br>
<input type="radio" name="two" value="2">Ah!Too cold for me!<br>
<input type="radio" name="two" value="3">Not bad at all<br>
<input type="radio" name="two" value="4">So what! I love it!<br>
</font>
<br><br>
<font color="hotpink"><b>When it reaches 100 degrees outside you would...</b><br>
<input type="radio" name="three" value="1">Sit in you air conditioned house<br>
<input type="radio" name="three" value="2">Go take in the sun<br>
<input type="radio" name="three" value="3">Take a cold shower<br>
<input type="radio" name="three" value="4">I hate summer!<br>
</font><br><br>
<font color="hotpink"><b>Your ideal vacation spot during the winter would be...</b><br>
<input type="radio" name="four" value="1">California<br>
<input type="radio" name="four" value="2">Florida<br>
<input type="radio" name="four" value="3">Arizona<br>
<input type="radio" name="four" value="4">New York<br>
</font>
<br><br>
<font color="hotpink"><b>If you had a choice on where you wanted to be during January, what part of the U.S. would you be in?</b><br>
<input type="radio" name="five" value="1">South<br>
<input type="radio" name="five" value="2">West<br>
<input type="radio" name="five" value="3">East<br>
<input type="radio" name="five" value="4">North<br>
<br>
<input type="button" value="What season am I? " onclick="process();" style="font-family:veranda; font-size=8pt; border:1; border-color:hotpink; border-style:solid; background-color:white"><br><br><br>
</body>
</html>