title: Form validation on submit don't work
body: <p>Hi so i was reading how to validate html forms, all my validators client side are working woth patterns and type. The problem is when i press submit the javascript validation dont run. There is my code:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  
  function validateForm()
  {
      var xa = document.forms["regform"]["password"].value;
      var xb = document.forms["regform"]["password2"].value;
      var xc = document.forms["regform"]["email"].value;
      var xd = document.forms["regform"]["email2"].value;
      if (xa == xb &amp;&amp; xc == xd){
          return true; }
      else{ return false; alert("Please enter a valid captcha code");}
  }
  
  $(document).ready(function(e) {
      try {
      $("body select").msDropDown();
      } catch(e) {
      alert(e.message);
      }
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Them the form:</p>
  
  <pre><code>&lt;form name="regform" onsubmit="return validateForm();" action="actions/register_acc.php" method="post"&gt;
  
  &lt;input type="password" name="password" class="input-style" required="required"&gt;
  &lt;input type="password2" name="password" class="input-style" required="required"&gt;
  
  &lt;input name="email" class="input-style" placeholder="your@email.com" required="required" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"&gt;
  &lt;input name="email2" class="input-style" placeholder="your@email.com" required="required" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"&gt;
  
  &lt;input type="submit" value="ok"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Inside the form i also have these:</p>
  
  <pre><code>&lt;select name="selectname" id="webmenu"&gt;
  &lt;option value="1"&gt;1&lt;/option&gt;
  &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And in the head these:</p>
  
  <pre><code>&lt;script src="js/msdropdown/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="js/msdropdown/jquery.dd.min.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>