title: HTML javascript valIdation not working
body: <p>I have this html with javascript validation form, but I don't know why it's not working. It's right now supposed to calculate the values of the two textboxes when the button is pressed. However nothing is happening. Code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;title&gt;Form Validator&lt;/title&gt;
  
  
  &lt;script type="text/javascript"&gt;
  //script here
  
  function Validate()
  {
  var numbers = /^[0-9]+$/;
  var emailRegex = /^[A-Za-z0-9._]*\@[A-Za-z]*\.[A-Za-z]{2,5}$/;
  var     fname  = document.myform.FullName.value,        
          fmobile = document.myform.Mobile.value,
          femail = document.myform.Email.value,
          fpass1 = document.myform.pass1.value,
          fpass2 = document.myform.pass2.value,   
          faddress = document.myform.Address.value;
  
  if( fname == "" )
     {
       document.myform.FullName.focus() ;
       document.getElementById("errorBox").innerHTML = "enter the name";
       return false;
     }
  
      if (fmobile == "" )
      {
          document.myform.Mobile.focus();
          document.getElementById("errorBox").innerHTML = "enter the Mobile Number";
          return false;
       }else if(!numbers.test(fmobile)){
          document.myform.Mobile.focus();
          document.getElementById("errorBox").innerHTML = "enter the valid Mobile number";
          return false;
       }
  
            if (femail == "" )
      {
          document.form.Email.focus();
          document.getElementById("errorBox").innerHTML = "enter the email";
          return false;
       }else if(!emailRegex.test(femail)){
          document.form.Email.focus();
          document.getElementById("errorBox").innerHTML = "enter the valid email";
          return false;
       }
  
  
     if (fpass1 == "" )
      {
          document.myform.pass1.focus();
          document.getElementById("errorBox").innerHTML = "enter the Password";
          return false;
       }else if(fpass1.length &gt; 8){
          document.myform.pass1.focus();
          document.getElementById("errorBox").innerHTML = "Password must be greater than 8 length";
          return false;
       }
  
        if (fpass2 == "" )
      {
          document.myform.pass2.focus();
          document.getElementById("errorBox").innerHTML = "enter the Confirm Password";
          return false;
       }
  
  
       if(fpass1 !=  fpass2){
           document.myform.enterEmail.focus();
           document.getElementById("errorBox").innerHTML = "Passwords are not matching, re-enter again";
           return false;
           }
  
  
                if (faddress == "" )
      {
          document.myform.Address.focus();
          document.getElementById("errorBox").innerHTML = "enter the Address";
          return false;
       }
  
           if(fname != '' &amp;&amp; fmobile != '' &amp;&amp; femail != '' &amp;&amp; fpass1 != '' &amp;&amp; fpass2 != '' &amp;&amp; faddress != '' ){
              document.getElementById("errorBox").innerHTML = "form submitted successfully";
              }
  
  
  
  }
  
  
  &lt;/script&gt;// script ends here
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="" name="myform" method="post" onsubmit="return Validate()" style="text-align:-moz-center;"&gt;
   // my html simple form start from here
  &lt;table cellspacing="2" cellpadding="2" border="0" &gt;
  &lt;tr&gt;
      &lt;td align="right"&gt;Full Name&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="FullName"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td align="right"&gt;Mobile&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="Mobile"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td align="right"&gt;Email&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="Email"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td align="right"&gt;Password&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="pass1"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td align="right"&gt;Confirm Password&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="pass2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td align="right"&gt;Address&lt;/td&gt;
      &lt;td&gt;&lt;textarea cols="20" rows="5" name="Address"&gt;&lt;/textarea&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
      &lt;td align="right"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="submit" value="Submit" "&gt; &lt;div id="errorBox"&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>