aaweth
06-28-2006, 09:13 AM
Hey there , I have been trying to work out how to get a quiz working but the button doesn't work and I don't know where to put the links to my results page within the java script... here is the script at the moment...
<html>
<head>
<title>LOTR Quiz - The Hobbit Round</title>
<font face="verdana" size="1">
<SCRIPT LANGUAGE="JavaScript">
<!--
function process()
{
var Excellent = 1;
var notbad = 2;
var morework = 3;
var tryagain = 4;
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 == "3") { Southern Star ++; }
if (value == "2") { Old Toby++; }
if (value == "1") { Longbottom Leaf ++; }
if (value == "4") { Southlinch++; }
for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;
if (value == "1") { Merry++; }
if (value == "2") { Pippin++; }
if (value == "3") { Bilbo++; }
if (value == "4") { Sam++; }
for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;
if (value == "1") { Tobold Hornblower++; }
if (value == "2") { Rosie Cotton++; }
if (value == "3") { Bungo Baggins++; }
if (value == "4") {Lobelia Bracegirdle++; }
for (i = 0; i < f.four.length; i++) if (f.four[i].checked) value = f.four[i].value;
if (value == "3") { Pipe-weed Grower++; }
if (value == "2") { Chef In The Green Dragon++; }
if (value == "1") { Mill Operator++; }
if (value == "4") { Mushroom Picker++; }
for (i = 0; i < f.five.length; i++) if (f.five[i].checked) value = f.five[i].value;
if (value == "3") { 17++; }
if (value == "2") { 20++; }
if (value == "1") { 33++; }
if (value == "4") { 55++; }
var out = "Excellent";
i = Excellent;
if (Excellent > i) { out = "Excellent"; i = Excellent; }
if (Notbad > i) { out = "NotBad"; i = Notbad; }
if (Morework > i) { out = "Morework"; i = Morework; }
if (Tryagain > i) { out = "Tryagain"; i = Tryagain; }
location.href = out + "http://www.freewebs.com/elvenwonder/Result1.html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
</head>
<body bgcolor=ffffff>
<center>
<font size=5><b>LOTR Quiz - The Hobbit Round</b></font><br><br><br><br>
<table width=525 border=0><tr><td>
<form name="The Hobbit Round">
Number 1: What type of Hobbit Tobbacco goes by the elvish name of Nicotiana? <br>
<input type="radio" name="one" value="2"> Old Toby<br>
<input type="radio" name="one" value="3"> Southern Star<br>
<input type="radio" name="one" value="1"> Longbottom Leaf<br>
<input type="radio" name="one" value="4"> Southlinch<br>
<br><br><br>
Number 2: Who wrote the book called “Herblore of the Shire’?<br>
<input type="radio" name="two" value="1"> Merry<br>
<input type="radio" name="two" value="2"> Pippin<br>
<input type="radio" name="two" value="3"> Bilbo<br>
<input type="radio" name="two" value="4"> Sam<br>
<br><br><br>
Number 3: Who was the first Hobbit to grow pipe-weed? <br>
<input type="radio" name="three" value="1"> Tobold Hornblower<br>
<input type="radio" name="three" value="2"> Rosie Cotton<br>
<input type="radio" name="three" value="3"> Bungo Baggins<br>
<input type="radio" name="three" value="4"> Lobelia Bracegirdle<br>
<br><br><br>
Number 4: Who was Ted Sandyman? <br>
<input type="radio" name="four" value="1"> Mill Operator<br>
<input type="radio" name="four" value="2"> Pipe-weed Grower<br>
<input type="radio" name="four" value="3"> Chef in the Green Dragon<br>
<input type="radio" name="four" value="4"> Mushroom Picker<br>
<br><br><br>
Number 5: How old do you have to be to be considered an adult Hobbit? <br>
<input type="radio" name="five" value="2"> 20<br>
<input type="radio" name="five" value="1"> 33<br>
<input type="radio" name="five" value="3"> 17<br>
<input type="radio" name="five" value="4"> 55<br>
<br><br><br>
<input type="button" value=" Click for results " onclick="process();"><br><br><br>
</td></tr></table>
<center>I learned how to make the quiz @ <a href="http://ticklez.net" target="_blank">ticklez.net</a>.</center>
</body>
</html>
and here are the links to my results pages
http://www.freewebs.com/elvenwonder/Result1.html (aka excellent)
http://www.freewebs.com/elvenwonder/Result2.html (aka notbad)
http://www.freewebs.com/elvenwonder/Result3.html (aka morework)
http://www.freewebs.com/elvenwonder/Result4.html (aka tryagain)
I would be so greatfulif somebody could help me out with this!!
Kayleigh
~x~
<html>
<head>
<title>LOTR Quiz - The Hobbit Round</title>
<font face="verdana" size="1">
<SCRIPT LANGUAGE="JavaScript">
<!--
function process()
{
var Excellent = 1;
var notbad = 2;
var morework = 3;
var tryagain = 4;
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 == "3") { Southern Star ++; }
if (value == "2") { Old Toby++; }
if (value == "1") { Longbottom Leaf ++; }
if (value == "4") { Southlinch++; }
for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;
if (value == "1") { Merry++; }
if (value == "2") { Pippin++; }
if (value == "3") { Bilbo++; }
if (value == "4") { Sam++; }
for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;
if (value == "1") { Tobold Hornblower++; }
if (value == "2") { Rosie Cotton++; }
if (value == "3") { Bungo Baggins++; }
if (value == "4") {Lobelia Bracegirdle++; }
for (i = 0; i < f.four.length; i++) if (f.four[i].checked) value = f.four[i].value;
if (value == "3") { Pipe-weed Grower++; }
if (value == "2") { Chef In The Green Dragon++; }
if (value == "1") { Mill Operator++; }
if (value == "4") { Mushroom Picker++; }
for (i = 0; i < f.five.length; i++) if (f.five[i].checked) value = f.five[i].value;
if (value == "3") { 17++; }
if (value == "2") { 20++; }
if (value == "1") { 33++; }
if (value == "4") { 55++; }
var out = "Excellent";
i = Excellent;
if (Excellent > i) { out = "Excellent"; i = Excellent; }
if (Notbad > i) { out = "NotBad"; i = Notbad; }
if (Morework > i) { out = "Morework"; i = Morework; }
if (Tryagain > i) { out = "Tryagain"; i = Tryagain; }
location.href = out + "http://www.freewebs.com/elvenwonder/Result1.html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
</head>
<body bgcolor=ffffff>
<center>
<font size=5><b>LOTR Quiz - The Hobbit Round</b></font><br><br><br><br>
<table width=525 border=0><tr><td>
<form name="The Hobbit Round">
Number 1: What type of Hobbit Tobbacco goes by the elvish name of Nicotiana? <br>
<input type="radio" name="one" value="2"> Old Toby<br>
<input type="radio" name="one" value="3"> Southern Star<br>
<input type="radio" name="one" value="1"> Longbottom Leaf<br>
<input type="radio" name="one" value="4"> Southlinch<br>
<br><br><br>
Number 2: Who wrote the book called “Herblore of the Shire’?<br>
<input type="radio" name="two" value="1"> Merry<br>
<input type="radio" name="two" value="2"> Pippin<br>
<input type="radio" name="two" value="3"> Bilbo<br>
<input type="radio" name="two" value="4"> Sam<br>
<br><br><br>
Number 3: Who was the first Hobbit to grow pipe-weed? <br>
<input type="radio" name="three" value="1"> Tobold Hornblower<br>
<input type="radio" name="three" value="2"> Rosie Cotton<br>
<input type="radio" name="three" value="3"> Bungo Baggins<br>
<input type="radio" name="three" value="4"> Lobelia Bracegirdle<br>
<br><br><br>
Number 4: Who was Ted Sandyman? <br>
<input type="radio" name="four" value="1"> Mill Operator<br>
<input type="radio" name="four" value="2"> Pipe-weed Grower<br>
<input type="radio" name="four" value="3"> Chef in the Green Dragon<br>
<input type="radio" name="four" value="4"> Mushroom Picker<br>
<br><br><br>
Number 5: How old do you have to be to be considered an adult Hobbit? <br>
<input type="radio" name="five" value="2"> 20<br>
<input type="radio" name="five" value="1"> 33<br>
<input type="radio" name="five" value="3"> 17<br>
<input type="radio" name="five" value="4"> 55<br>
<br><br><br>
<input type="button" value=" Click for results " onclick="process();"><br><br><br>
</td></tr></table>
<center>I learned how to make the quiz @ <a href="http://ticklez.net" target="_blank">ticklez.net</a>.</center>
</body>
</html>
and here are the links to my results pages
http://www.freewebs.com/elvenwonder/Result1.html (aka excellent)
http://www.freewebs.com/elvenwonder/Result2.html (aka notbad)
http://www.freewebs.com/elvenwonder/Result3.html (aka morework)
http://www.freewebs.com/elvenwonder/Result4.html (aka tryagain)
I would be so greatfulif somebody could help me out with this!!
Kayleigh
~x~