title: Javascript function not being called using onsubmit in html form
body: <p>I have a pretty simple html file with a validation function in javascript that I am trying to make execute when the form is submitted.  However, I can not get the is_checked() function to run as evidence by no console log statements being executed.  I am using Eclipse and an Apache TomCat 7 server which is properly executing all jsp, servlet, and html code but no javascript.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="ISO-8859-1"&gt;
  &lt;title&gt;Example&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  function is_checked() { 
      console.log("is_checked() was called");
      var taskChecked = document.getElementByID('task').checked;
      var projectChecked = document.getElementByID('project').checked;
      var autoChecked = document.getElementByID('auto').checked;
      var manualChecked = document.getElementByID('manual').checked;
  
      console.log("taskChecked " + taskChecked);
      console.log("projectChecked " + projectChecked);
      console.log("manualChecked " + manualChecked);
      console.log("autoChecked " + autoChecked);
  
  
      if((taskChecked === "true" || projectChecked === "true") 
       &amp;&amp; (autoChecked === "true" || manualChecked === "true")) {
          return true;
      } else {
          alert('Must select task or project and either auto or manual!');
          return false;
      }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="#" onsubmit="return is_checked()" method="post"&gt;
  &lt;table&gt;
      &lt;tr&gt;
        &lt;td&gt;Process Level: &lt;/td&gt;
        &lt;td&gt;
         &lt;input type="radio" name="process" value="task" id="task"&gt;Task
        &lt;/td&gt;
        &lt;td&gt;
           &lt;input type="radio" name="process" value="project"
            id="project"&gt;Project
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Method Type: &lt;/td&gt;
          &lt;td&gt;
           &lt;input type="radio" name="method" value="auto" id="auto"&gt;Auto
         &lt;/td&gt;
          &lt;td&gt;
           &lt;input type="radio" name="method" value="manual" 
               id="manual"&gt;Manual
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td colspan="2"&gt;
              &lt;textarea name="ids" rows="15" cols="10"&gt;&lt;/textarea&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
           &lt;input type="submit" value="Submit"&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>