title: Odd behavoir from validation script
body: <p>I have this script and form that I alteret so that I can pass a variable. The original was called by onSubmit='return validateForm()'. After altering the script, only onClick will work. If using onSubmit, it just submits thr form no matter checked og not.</p>
  
  <p>Can anybody tell me why the difference in behavior?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  function validateForm(a) {
  var radios = document.getElementsByName('tjek' + [a]);
  var radiosChecked = false;
  
  var i = 0;
  while (!radiosChecked &amp;&amp; i &lt; radios.length) {
      if (radios[i].checked) radiosChecked = true;
      i++;
  }
  
  
  if (!radiosChecked) {
      alert("Du skal vælge en mulighed!")
      return false;
  }
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form name="Form" action="http://google.com" method="get"&gt;
      &lt;input name="tjek1" type="radio" value="" /&gt;
      &lt;input name="tjek1" type="radio" value="" /&gt;
      &lt;input type="submit" value="Send" onClick="return validateForm(1)" /&gt;
  &lt;/form&gt;
  
  &lt;form name="Form" action="http://bing.com" method="get"&gt;
      &lt;input name="tjek2" type="radio" value="" /&gt;
      &lt;input name="tjek2" type="radio" value="" /&gt;
      &lt;input type="submit" value="Send" onClick="return validateForm(2)"  /&gt;
  &lt;/form&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>