working on a onsubmit
<p>I am working on a form. I need to have a  onsubmit form handler. And to create a validation script to make sure the fields are not empty. When I go to this when I click the submit form nothing happens. Something should pop up letting me know i didnt fill something out. Can someone tell me what I am doing wrong.</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;RSVP&lt;/title&gt;
&lt;script type="text/javascript"&gt;
function verify() {
var themessage = "You are required to complete the following fields: ";
if (document.form.first.value=="") {
themessage = themessage + " - First Name";
 }
if (document.form.last.value=="") {
themessage = themessage + " -  Last Name";
}
if (document.form.NumberofGuest.value=="") {
themessage = themessage + " -  Number of guest";
}
if (document.form.TimeArriving.value=="") {
themessage = themessage + " -  Time Arriving";
}
if (document.form.email.value=="") {
themessage = themessage + " -  E-mail";
}
//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following fields: ") {
document.form.submit();
 }
else {
alert(themessage);
return false;
   }

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

  &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;h2&gt;**RSVP to my Party**&lt;/h2&gt;
 &lt;form  name=form method="post" action="mailto:sha1023012@yahoo.com?cc=sha1023102@yahoo.com, subject=RSVP"  enctype="text/plain" onsubmit="return confirmSubmit();" onreset="return confirmReset();"&gt;
 &lt;input type=text name="first" size="20"&gt; First Name&lt;BR&gt;
 &lt;input type=text name="last" size="20"&gt; Last Name&lt;BR&gt;

&lt;input type=text name="NumberofGuest" size="20"&gt; Number of Guest&lt;BR&gt;
&lt;input type=text name="TimeArriving" size="20"&gt; Time Arriving&lt;BR&gt;
&lt;input type=text name="email" size="20"&gt; E-Mail&lt;BR&gt;&lt;BR&gt;
&lt;input type=button value="Submit Request" onclick="verify();"&gt;

&lt;input type=reset value="Clear Form"&gt;&lt;br&gt;
&lt;/form&gt;
</code></pre>

<p></p>

<p></p>
