title: javascript function in jsp page
body: <p>I have jsp page - </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;legend&gt;Create new customer&lt;/legend&gt;
      &lt;script Language="JavaScript"&gt;
          function checkForm() {
  
              alert("YOU ARE IN checkForm FUNCTION !");
              return (false);
          }
      &lt;/script&gt;
      &lt;form action="CreateCustomerServlet" method="GET" onsubmit="checkForm"&gt;
          // form fields ... 
          &lt;input type="submit" value="Create customer" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I run on server this page and press on the <code>submit</code> button I see that it ignore <code>checkForm</code> and don't enter him , and directly go to <code>CreateCustomerServlet</code> .</p>
  
  <p>My goals is that when press on <code>submit</code> it go to <code>checkForm</code> and if <code>checkForm</code> returns <code>true</code> only then it will go to <code>CreateCustomerServlet</code>  . what I have to change in order to get this goal ?</p>