View Full Version : My quiz code won't work!!!


glittergurl
07-09-2003, 07:32 PM
Hi, I need help with a few quizes I've made quizes before and they worked, I didn't edit the codes, but one day they stopped working after you take the quiz the status bar just says error. I made a new quiz the other day, it won't work at all and I checked the code numerous times, could somebody tell me what I did wrong with this code?
<HTML>
<style type="text/css"><!-- hr{color:deepskyblue;width:348;height:4;border-bottom: SOLID 1pt deepskyblue; border-top: SOLID 1pt deepskyblue;border-left: solid 1pt deepskyblue;
border-right: solid 1pt deepskyblue;text-align:center} body,tr,td,i,font,textarea,input{color:black;
font-size:9pt; font-family:arial; text-align:; font-weight:normal; font-style:normal; line-height:9pt; scrollbar-arrow-color:white; scrollbar-base-color:hotpink; scrollbar-darkshadow-color:
hotpink; scrollbar-shadow-color:hotpink; scrollbar-highlight-color:hotpink; scrollbar-track-color:deepskyblue} A:link,
A:visited{color:cc66ff; TEXT-DECORATION:none; font-weight:bold;font-size:9pt} A:hover{color:cc99ff; TEXT-DECORATION:none; font-style:normal; font-weight:bold} b{color:hotpink; font-weight:bold; font-size:9pt;
font-family:arial; cursor:nw-resize;line-height:17pt} u{color:deepskyblue; font-weight:bold; font-size:9pt; font-family:arial; cursor:nw-resize; font-style:normal; text-decoration:none}i,font{color:black; font-weight:none; font-size:8pt; font-family:arial; cursor:nw-resize; font-style:normal; text-decoration:none}--></STYLE>
<HEAD>
<TITLE>Which of my fave movies are you?</TITLE>
<script language="JavaScript"> <!--
// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
//provided free at http://www.lissaexplains.com
// Don't delete this header!

var message="If you want something ask!"; // Message for the alert box

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> </script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function process()
{
var movie1 = 0;
var movie2 = 0;
var movie3 = 0;
var movie4 = 0;
var movie5 = 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") { movie1++; }
if (value == "2") { movie2++; }
if (value == "3") { movie3++; }
if (value == "4") { movie4++; }
if (value == "5") { movie5++; }

for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;
if (value == "1") { movie5+; movie4++; moviea2++; }
if (value == "2") { movie3++; movie1++; }

for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;
if (value == "1") { movie1++; }
if (value == "2") { movie2++; movie3++; movie5++; }
if (value == "3") { movie4++; }

for (i = 0; i < f.four.length; i++) if (f.four[i].checked) value = f.four[i].value;
if (value == "1") { movie2++; movie5++; }
if (value == "2") { movie3++; }
if (value == "3") { movie4++; }
if (value == "4") { movie1++; }

for (i = 0; i < f.five.length; i++) if (f.five[i].checked) value = f.five[i].value;
if (value == "1") { movie2++; movie3++; }
if (value == "2") { movie1++; }
if (value == "3") { movie4++; }
if (value == "4") { movie5++; }


for (i = 0; i < f.six.length; i++) if (f.six[i].checked) value = f.six[i].value;
if (value == "1") { movie1++; }
if (value == "2") { movie3++; }
if (value == "3") { movie5++; }
if (value == "4") { movie2++; }
if (value == "5") { movie4++; }


for (i = 0; i < f.seven.length; i++) if (f.seven[i].checked) value = f.seven[i].value;
if (value == "1") { movie4++; }
if (value == "2") { movie2++; }
if (value == "3") { movie1++; }
if (value == "4") { movie3++; }
if (value == "5") { movie5++; }

for (i = 0; i < f.eight.length; i++) if (f.eight[i].checked) value = f.eight[i].value;
if (value == "1") { movie5++; }
if (value == "2") { movie3++; }
if (value == "3") { movie4++; movie1++;}
if (value == "4") { movie2++; }

for (i = 0; i < f.nine.length; i++) if (f.nine[i].checked) value = f.nine[i].value;
if (value == "1") { movie2++; }
if (value == "2") { movie1++; }
if (value == "3") { movie5++; }
if (value == "4") { movie3++; }
if (value == "5") { movie4++; }

for (i = 0; i < f.ten.length; i++) if (f.ten[i].checked) value = f.ten[i].value;
if (value == "1") { movie2++; movie3++; }
if (value == "2") { movie1++; movie4++; movie5++; }

var out = "movie1";
i = movie1;
if (movie2 > i) { out = "movie2"; i = movie2 ; }
if (movie3 > i) { out = "movie3"; i = movie3 ; }
if (movie4 > i) { out = "movie4"; i = movie4 ; }
if (movie5 > i) { out = "movie5"; i = movie5 ; }
location.href = out + ".html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
</HEAD>
<BODY>
<center>
<body bgcolor="#ffffff" text="#000000">
<table border=0 cellpadding=0 cellspacing=0 width=500>
<tr><td>
<font face="verdana">
<font size="2">
<font color="#000000">
<img src="whichmovie.jpg" align="left">
<b>What of my fave movies do you belong in?</b>
<BR><BR><BR><BR>
Which movie do you belong in?
<BR><BR><BR><BR><BR><BR><BR>
<FORM NAME="f">

<a class="question">1. The 80s were:</a>
<BR>
<INPUT TYPE="radio" NAME="one" VALUE="1"> Right now, not the 1980s but...<BR>
<INPUT TYPE="radio" NAME="one" VALUE="2"> OMG! Pink legwarmers are back in a BIG way!!!<BR>
<INPUT TYPE="radio" NAME="one" VALUE="3"> All decades seem the same to me<BR>
<INPUT TYPE="radio" NAME="one" VALUE="4"> When I was born, nothing more<BR>
<INPUT TYPE="radio" NAME="one" VALUE="5"> Completely fabulous<BR>

<p><BR><p>

<a class="question">2. Comedy is awesome, *the best*, kick-bum right?</a>
<BR>
<INPUT TYPE="radio" NAME="two" VALUE="1"> Right<BR>
<INPUT TYPE="radio" NAME="two" VALUE="2"> Not so much<BR>


<p><BR><p>

<a class="question">3. The biggest issue in your life is:</a>
<BR>
<INPUT TYPE="radio" NAME="three" VALUE="1"> The most evil being EVER wants you dead<BR>
<INPUT TYPE="radio" NAME="three" VALUE="2"> I'm out of my comfort zone and everyone is judging me<BR>
<INPUT TYPE="radio" NAME="three" VALUE="3"> Oh, my life is peachy-keen well except my wife is dead, I'm lost with no money, my 'best friend' hates me...<BR>

<p><BR><p>

<a class="question">4. How important are fashion and beauty to you?</a>
<BR>
<INPUT TYPE="radio" NAME="four" VALUE="1"> EXTREMELY IMPORTANT!<BR>
<INPUT TYPE="radio" NAME="four" VALUE="2"> A prority<BR>
<INPUT TYPE="radio" NAME="four" VALUE="3"> I try to stay clean<BR>
<INPUT TYPE="radio" NAME="four" VALUE="4"> uh?<BR>

<p><BR><p>

<a class="question">5. Reese Witherspoon is...</a>
<BR>
<INPUT TYPE="radio" NAME="five" VALUE="1"> My idol!<BR>
<INPUT TYPE="radio" NAME="five" VALUE="2"> Resse who? Is he son of Ruse?<BR>
<INPUT TYPE="radio" NAME="five" VALUE="3"> Oh, do you mean Resse Pieces?<BR>
<INPUT TYPE="radio" NAME="five" VALUE="4"> Awesome!!! =) <BR>

<p><BR><p>

<a class="question">6. Do you travel much?</a>
<BR>
<INPUT TYPE="radio" NAME="six" VALUE="1"> I'm on a huge jouney right now<BR>
<INPUT TYPE="radio" NAME="six" VALUE="2"> I seem to pass through the decades like miles is that 'traveling?'<BR>
<INPUT TYPE="radio" NAME="six" VALUE="3"> Life is a journey, or someting deep like that<BR>
<INPUT TYPE="radio" NAME="six" VALUE="4"> I drive across the country as if I'm going down the street<BR>
<INPUT TYPE="radio" NAME="six" VALUE="5"> Yes, often but I get lost sometimes<BR>


<p><BR><p>

<a class="question">7. Are you rich?</a>
<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="1"> No!<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="2"> Yes, well my parents are<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="3"> Yes, by inhertince<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="4"> Yes, no...kinda; somewhat<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="5"> I was very poor growing up, now I'm rich by all my own 'hard work'<BR>

<p><BR><p>

<a class="question">8. Are you smart?</a>
<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="1"> uh? I mean true 'er flase um... a)?<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="2"> I could be<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="3"> I guess so<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="4"> Yes if only people took me serouilsy<BR>

<p><BR><p>

<a class="question">9. What's your fave color?</a>
<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="1"> *PINK*! ;-)<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="2"> Dark green or brown<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="3"> Electric blue<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="4"> Anything but, black or white<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="5"> Orange<BR>

<p><BR><p>

<a class="question">10. You are...</a>
<BR>
<INPUT TYPE="radio" NAME="ten" VALUE="1"> A girl<BR>
<INPUT TYPE="radio" NAME="ten" VALUE="2"> A guy<BR>

<p><BR><p>
<a class="button"><INPUT TYPE="button" VALUE="Rent Me" onClick="process();" style="font-family: verdana"
style="color: black"
style="border: solid"
style="font-size: 12"
style="background: #ffffff"></a></center></FORM>
</td>
</tr>
</table>
<noembed>
</BODY>
</HTML>

Thank you so much!
-Tara

rundellt2000
07-11-2003, 11:27 AM
I'm pretty sure the problem is with you having multiple outcomess (movie3, movie4) in 1 answer in the quiz, like in question 2. (Comedy kicks ^^^^) or something like that.

Dude128
07-11-2003, 01:58 PM
that shouldn't be a problem, because in any JavaScript, statements can be separated using semicolons as was done in that code.

the only problem I see is that in question two you have a typo- moviea2++
also, your CSS should go inside the head section of the page- you shouldn't have anything between the <html> and <head> tags.

glittergurl
07-11-2003, 05:07 PM
Thank you so much for your advice!!!
I've made the changes, but the quiz still won't work here is the new script

<HTML>
<HEAD>
<TITLE>Which of my fave movies are you?</TITLE>
<script language="JavaScript"> <!--
// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
//provided free at http://www.lissaexplains.com
// Don't delete this header!

var message="If you want something ask!"; // Message for the alert box

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> </script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function process()
{
var movie1 = 0;
var movie2 = 0;
var movie3 = 0;
var movie4 = 0;
var movie5 = 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") { movie1++; }
if (value == "2") { movie2++; }
if (value == "3") { movie3++; }
if (value == "4") { movie4++; }
if (value == "5") { movie5++; }

for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;
if (value == "1") { movie5+; movie4++; movie2++; }
if (value == "2") { movie3++; movie1++; }

for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;
if (value == "1") { movie1++; }
if (value == "2") { movie2++; movie3++; movie5++; }
if (value == "3") { movie4++; }

for (i = 0; i < f.four.length; i++) if (f.four[i].checked) value = f.four[i].value;
if (value == "1") { movie2++; movie5++; }
if (value == "2") { movie3++; }
if (value == "3") { movie4++; }
if (value == "4") { movie1++; }

for (i = 0; i < f.five.length; i++) if (f.five[i].checked) value = f.five[i].value;
if (value == "1") { movie2++; movie3++; }
if (value == "2") { movie1++; }
if (value == "3") { movie4++; }
if (value == "4") { movie5++; }


for (i = 0; i < f.six.length; i++) if (f.six[i].checked) value = f.six[i].value;
if (value == "1") { movie1++; }
if (value == "2") { movie3++; }
if (value == "3") { movie5++; }
if (value == "4") { movie2++; }
if (value == "5") { movie4++; }


for (i = 0; i < f.seven.length; i++) if (f.seven[i].checked) value = f.seven[i].value;
if (value == "1") { movie4++; }
if (value == "2") { movie2++; }
if (value == "3") { movie1++; }
if (value == "4") { movie3++; }
if (value == "5") { movie5++; }

for (i = 0; i < f.eight.length; i++) if (f.eight[i].checked) value = f.eight[i].value;
if (value == "1") { movie5++; }
if (value == "2") { movie3++; }
if (value == "3") { movie4++; movie1++;}
if (value == "4") { movie2++; }

for (i = 0; i < f.nine.length; i++) if (f.nine[i].checked) value = f.nine[i].value;
if (value == "1") { movie2++; }
if (value == "2") { movie1++; }
if (value == "3") { movie5++; }
if (value == "4") { movie3++; }
if (value == "5") { movie4++; }

for (i = 0; i < f.ten.length; i++) if (f.ten[i].checked) value = f.ten[i].value;
if (value == "1") { movie2++; movie3++; }
if (value == "2") { movie1++; movie4++; movie5++; }

var out = "movie1";
i = movie1;
if (movie2 > i) { out = "movie2"; i = movie2 ; }
if (movie3 > i) { out = "movie3"; i = movie3 ; }
if (movie4 > i) { out = "movie4"; i = movie4 ; }
if (movie5 > i) { out = "movie5"; i = movie5 ; }
location.href = out + ".html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
</HEAD>
<BODY>
<center>
<body bgcolor="#ffffff" text="#000000">
<table border=0 cellpadding=0 cellspacing=0 width=500>
<tr><td>
<font face="verdana">
<font size="2">
<font color="#000000">
<img src="whichmovie.jpg" align="left">
<b>What of my fave movies do you belong in?</b>
<BR><BR><BR><BR>
Which movie do you belong in?
<BR><BR><BR><BR><BR><BR><BR>
<FORM NAME="f">

<a class="question">1. The 80s were:</a>
<BR>
<INPUT TYPE="radio" NAME="one" VALUE="1"> Right now, not the 1980s but...<BR>
<INPUT TYPE="radio" NAME="one" VALUE="2"> OMG! Pink legwarmers are back in a BIG way!!!<BR>
<INPUT TYPE="radio" NAME="one" VALUE="3"> All decades seem the same to me<BR>
<INPUT TYPE="radio" NAME="one" VALUE="4"> When I was born, nothing more<BR>
<INPUT TYPE="radio" NAME="one" VALUE="5"> Completely fabulous<BR>

<p><BR><p>

<a class="question">2. Comedy is awesome, *the best*, kick-bum right?</a>
<BR>
<INPUT TYPE="radio" NAME="two" VALUE="1"> Right<BR>
<INPUT TYPE="radio" NAME="two" VALUE="2"> Not so much<BR>


<p><BR><p>

<a class="question">3. The biggest issue in your life is:</a>
<BR>
<INPUT TYPE="radio" NAME="three" VALUE="1"> The most evil being EVER wants you dead<BR>
<INPUT TYPE="radio" NAME="three" VALUE="2"> I'm out of my comfort zone and everyone is judging me<BR>
<INPUT TYPE="radio" NAME="three" VALUE="3"> Oh, my life is peachy-keen well except my wife is dead, I'm lost with no money, my 'best friend' hates me...<BR>

<p><BR><p>

<a class="question">4. How important are fashion and beauty to you?</a>
<BR>
<INPUT TYPE="radio" NAME="four" VALUE="1"> EXTREMELY IMPORTANT!<BR>
<INPUT TYPE="radio" NAME="four" VALUE="2"> A prority<BR>
<INPUT TYPE="radio" NAME="four" VALUE="3"> I try to stay clean<BR>
<INPUT TYPE="radio" NAME="four" VALUE="4"> uh?<BR>

<p><BR><p>

<a class="question">5. Reese Witherspoon is...</a>
<BR>
<INPUT TYPE="radio" NAME="five" VALUE="1"> My idol!<BR>
<INPUT TYPE="radio" NAME="five" VALUE="2"> Resse who? Is he son of Ruse?<BR>
<INPUT TYPE="radio" NAME="five" VALUE="3"> Oh, do you mean Resse Pieces?<BR>
<INPUT TYPE="radio" NAME="five" VALUE="4"> Awesome!!! =) <BR>

<p><BR><p>

<a class="question">6. Do you travel much?</a>
<BR>
<INPUT TYPE="radio" NAME="six" VALUE="1"> I'm on a huge jouney right now<BR>
<INPUT TYPE="radio" NAME="six" VALUE="2"> I seem to pass through the decades like miles is that 'traveling?'<BR>
<INPUT TYPE="radio" NAME="six" VALUE="3"> Life is a journey, or someting deep like that<BR>
<INPUT TYPE="radio" NAME="six" VALUE="4"> I drive across the country as if I'm going down the street<BR>
<INPUT TYPE="radio" NAME="six" VALUE="5"> Yes, often but I get lost sometimes<BR>


<p><BR><p>

<a class="question">7. Are you rich?</a>
<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="1"> No!<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="2"> Yes, well my parents are<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="3"> Yes, by inhertince<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="4"> Yes, no...kinda; somewhat<BR>
<INPUT TYPE="radio" NAME="seven" VALUE="5"> I was very poor growing up, now I'm rich by all my own 'hard work'<BR>

<p><BR><p>

<a class="question">8. Are you smart?</a>
<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="1"> uh? I mean true 'er flase um... a)?<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="2"> I could be<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="3"> I guess so<BR>
<INPUT TYPE="radio" NAME="eight" VALUE="4"> Yes if only people took me serouilsy<BR>

<p><BR><p>

<a class="question">9. What's your fave color?</a>
<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="1"> *PINK*! ;-)<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="2"> Dark green or brown<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="3"> Electric blue<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="4"> Anything but, black or white<BR>
<INPUT TYPE="radio" NAME="nine" VALUE="5"> Orange<BR>

<p><BR><p>

<a class="question">10. You are...</a>
<BR>
<INPUT TYPE="radio" NAME="ten" VALUE="1"> A girl<BR>
<INPUT TYPE="radio" NAME="ten" VALUE="2"> A guy<BR>

<p><BR><p>
<a class="button"><INPUT TYPE="button" VALUE="Rent Me" onClick="process();" style="font-family: verdana"
style="color: black"
style="border: solid"
style="font-size: 12"
style="background: #ffffff"></a></center></FORM>
</td>
</tr>
</table>
</BODY>
</HTML>

Thank You, so much for your help
-Tara

rundellt2000
07-11-2003, 10:38 PM
oh. soz :blush:

I've heard there can be some problems with running two (2) javascripts on one (1) page.