title: form onsubmit not working
body: <p>I've been looking for 3 hours now for this error, and I can't for the life of me find it. It looks like the onsubmit isn't being called for whatever reason. I'm trying to make sure the user enters a non-negative number in each field</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
          &lt;script type="text/javascript"&gt;
          function validate(){
                  var wid1 = document.getElementByName("widget1").value;
                  var wid2 = document.getElementByName("widget2").value;
                  var wid3 = document.getElementByName("widget3").value;
                  if(isNaN(wid1)||isNaN(wid2)||isNaN(wid3)){
                          alert("all values entered must be numbers");
                          return false;
                  }
                  else if(wid1 &lt; 0 || wid2 &lt; 0 || wid3 &lt; 0){
                          alert("all values must be greater than zero");
                          return false;
                  }
                  if(wid1+wid2+wid3 &gt; 25){
                          if(!confirm("you have more than 25 items. Will you accept the additional shipping?")){
                                  return false;
                          }
                  }
                  return true;
          }
          &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
           &lt;form name="order" action="calculations.php" method="get" onsubmit="return validate()"&gt;
                  &lt;p&gt;37AX-L:&lt;/p&gt;
                  &lt;input type="text" name="widget1" value="0" required/&gt;
                  &lt;br&gt;
                  &lt;p&gt;42XR-J&lt;/p&gt;
                  &lt;input type="text" name="widget2" value="0" required/&gt;
                  &lt;br&gt;
                  &lt;p&gt;93XX-A&lt;/p&gt;
                  &lt;input type="text" name="widget3" value="0" required/&gt;
                  &lt;br&gt;
                  &lt;input type="radio" name="State" value="MO" checked&gt;Missouri&lt;/input&gt;
                  &lt;br&gt;
                  &lt;input type="radio" name="State" value="IL"&gt;Illinois&lt;/input&gt;
                  &lt;br&gt;
                  &lt;input type="submit" value="submit"/&gt;
          &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>