Javascript Form validator please
<p>Yes, this is a homework question.
"Create a script that requires your visitors to accept your terms and conditions before proceeding, by selecting a check box. Save the page as AcceptTerms.html. Include two links, an Accept link and a Decline link. The Accept link should open a page named AcceptPage.html that displays the text “Thank you for accepting our terms.” The Decline link should open a page named DeclinePage.html that displays the text “You did not accept our terms.” In the AcceptTerms.html document, create a single event handler function named confirmTerms() that determines whether the check box is selected and returns a value of true if it is or false if it isn’t. Call the confi rmTerms() function from the Accept link. If the check box is selected, open the AcceptPage.html document. If the check box is not selected, display an alert dialog box informing the user that he or she must accept the terms. If the user clicks the Decline link, open the DeclinePage.html document."</p>

<p>Although, my teacher sent this message after (kind of confused me): "On your form page, be sure to set your form action to this page.  One example of how to do that is shown below.  Note that the form tag points to 2 functions.  Remember these functions should be included in your  area.  You may need to use additional functions to validate specific sections, such as password or checking for number.</p>

<pre><code>&lt;form action="FormProcessor.html" method="get"
enctype="application/x-www-form-urlencoded"
onsubmit="return confirmSubmit();"
onreset="return confirmReset();"&gt;
</code></pre>

<p>I have put together the coding that I believed would work, unfortunately it doesn't. I am still new to Javascript so can you point me in the right direction here.</p>

<pre><code>&lt;head&gt;
&lt;title&gt;Accept Terms&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;script type="text/javascript"&gt; 
/* &lt;![CDATA[ */
function confirmSubmit()
{
var accept=document.getElementById('myForm').accept.value;

if (document.myForm.accept.checked==false &amp;&amp; document.myForm.decline.checked == false) { 
alert("You did not select a box.");
return false
}
if (document.myForm.accept.checked==true &amp;&amp; document.myForm.decline.checked == true) { 
alert("You may only select one box!");
return false
}
if (document.myForm.accept.checked) {
window.location.href = "AcceptPage.html";
}
if (document.myForm.decline.checked) {
window.location.href = "DeclinePage.html";
}
}

function confirmReset() {
var resetForm = window.confirm("Are you sure you want to reset the form?");
if (resetForm == true)
    return true;
return false;
}

/* ]]&gt; */
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="myForm" id="myForm"&gt;
&lt;p&gt;Do you agree to the terms?&lt;/p&gt;
&lt;table width=150&gt;
&lt;tr&gt;
&lt;td&gt;I Accept
&lt;input name="accept" type="checkbox" /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;I Decline 
&lt;input name="decline" type="checkbox" /&gt;
&lt;/td&gt;
&lt;/tr&gt; 
&lt;/table&gt;
&lt;br&gt;
&lt;table border=0&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;button name="button" type="submit" "&gt;Submit&lt;/button&gt;
&lt;button name="button1" type="reset" "&gt;Reset&lt;/button&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;form action="FormProcessor.html" method="get"
enctype="application/x-www-form-urlencoded"
onsubmit="return confirmSubmit();"
onreset="return confirmReset();"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
