title: HTML Forms - Calling JavaScript via the onsubmit event handler
body: <p>I am creating a simple HTML form and calling a JavaScript file via the onsubmit event handler. Oddly, whenever I click the submit button, my JS file does not fire. Help? </p>
  
  <p>**UPDATED CODES</p>
  
  <p>This is what I have for my condensed HTML file:</p>
  
  <pre><code>&lt;html&gt;
  &lt;form name="form01" id="form01" action="http://itins3.madisoncollege.edu/echo.php"
        method="post" onsubmit="return checkAllTextBoxes();"&gt;
  
        &lt;label for="actualFirstName" class="setWidth"&gt;First Name:&lt;/label&gt;
        &lt;input type="text" name="actualFirstName" id="actualFirstName" /&gt;
  
        &lt;input type="submit" value="Send Form" /&gt;
  
  &lt;/form&gt;
  &lt;/html&gt;
  &lt;script src="/javaScriptFiles/newArtist.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This is what I have for my JS file:</p>
  
  <pre><code>function checkAllTextBoxes()
  {
       if (document.form01.actualFirstName.value.length &lt; 2)
       {
            alert("First name is too short- must be at least two characters or more.");
            return false;
       }
  
       return true;
  }
  </code></pre>
  
  <p>I have been trying to figure out what went wrong, but can't seem to find the bug in my code. Tried JSHint, Firebug (FireFox), and even HTML online validators and no bugs came up. Another pair of coding eyes will be a big help. Thanks. </p>