I am making a online quiz for somebody.
My code is
Code: Select all
<html><font face=garamond><b>
<body bgcolor=black>
<title>Mr. Farris' Online Test </title>
<head>
<SCRIPT language="JavaScript" type="text/javascript">
function checkAnswer(quizForm,
theAnswer,
urlRight,
urlWrong)
{
var s = "?";
// go through the "current choices"
// to find the selected choice.
// radio boxes pointing to choices
// must be named "cc"
// change if necessary
//
var i = 0;
for(;i<quizForm.elements.length;i++)
{
if(("cc" ==
quizForm.elements[i].name) &&
(quizForm.elements[i].checked))
{
s = quizForm.elements[i].value;
}
}
// no choice was selected
//
if("?" == s)
{
alert("Please make a selection.");
return false;
}
// check if we have the correct
// choice selected
//
if(s == theAnswer)
{
alert("'"+s+"' is correct!");
if(urlRight)
{
document.location.href = urlRight;
}
}
else
{
alert("'"+s+"' is incorrect.");
if( urlWrong )
{
document.location.href = urlWrong;
}
}
// return "false" to indicate not to
// submit the form.
// change this to "true" if the form
// "action" is valid,
// i.e. points to a valid CGI script
//
return false;
}
</SCRIPT>
</head>
<font size=5 color=#DAA520><center><b><u>
Mr. Farris' Online Test</b></center></font></u>
<div align=right><font size=2 color=white><a onClick="javascript:window.close();">[exit]</a>
<hr>
<br><br><br><br>
</div><div align=center><TABLE WIDTH=600 CELLPADDING=8 CELLSPACING=0 border=1 bordercolor=black BGCOLOR="ivory">
<TR><TD bgcolor=#DAA520>
<FONT FACE="garamonda" SIZE=+0 COLOR="black">
<B>Question #1
</B></FONT>
</TD></TR>
<TR>
<FORM method=POST onSubmit="return checkAnswer(this,'B');">
<TD valign="top">
<TABLE WIDTH=100% CELLPADDING=10 CELLSPACING=0 BORDER=0 BGCOLOR="#DAA520">
<TR>
<TD height="23" valign="top">
<b> Is Mr. Farris Cool?</b><BR>
<BR>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD VALIGN=top>
<INPUT TYPE="Radio" NAME="cc" VALUE="A">
</TD>
<TD VALIGN=top> 1. </TD>
<TD VALIGN=top>
no!
<BR>
<FONT SIZE=-2> <BR>
</FONT></TD>
</TR>
<TR>
<TD VALIGN=top>
<INPUT TYPE="Radio" NAME="cc" VALUE="B">
</TD>
<TD VALIGN=top> 2. </TD>
<TD VALIGN=top>
mybee
<BR>
<FONT SIZE=-2> <BR>
</FONT></TD>
</TR>
<TR>
<TD VALIGN=top>
<INPUT TYPE="Radio" NAME="cc" VALUE="C">
</TD>
<TD VALIGN=top> 3. </TD>
<TD VALIGN=top>
yeah
<BR>
<FONT SIZE=-2> <BR>
</FONT></TD>
</TR>
<TR>
<TD VALIGN=top>
<INPUT TYPE="Radio" NAME="cc" VALUE="D">
</TD>
<TD VALIGN=top> 4. </TD>
<TD VALIGN=top>
sometimes
<BR>
<FONT SIZE=-2> <BR>
</FONT></TD>
</TR>
</TABLE>
<CENTER><INPUT TYPE="submit" VALUE="Check Your Answer"></CENTER>
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
</div>
</form>
</head>
<body>
<form>
<BR><BR><BR><BR><BR><BR><BR><BR><BR>I can not figure out what is wrong. Can You?The requested method POST is not allowed for the URL /farris/farris.htm.
Thank You!!