title: How to disable form validation for some submit button?
body: <p>In my jsp form page, I have two submit button "Save" and "Cancel". When I click on both buttons it validates the form. I tried to put keyword "formnovalidate" for cancel button. But its not working.</p>
  
  <p>Here I mentioned my button code:</p>
  
  <pre><code>&lt;form id = "myForm" method="POST" onsubmit="return validateForm()" &gt;
  ..........
  &lt;tr &gt;
  &lt;td class="td_left"&gt;&lt;input type="submit" value="save" onclick="form.action='${pageContext.servletContext.contextPath}/insert'"/&gt;&lt;/td&gt;
  &lt;td class="td_right"&gt;&lt;input type="submit" value="Cancel" onclick="form.action='${pageContext.servletContext.contextPath}/home'" formnovalidate  /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  ................
  &lt;/form&gt;
  </code></pre>
  
  <p>Validations:</p>
  
  <pre><code>function validateForm() {
  var x = document.forms["myForm"]["spcrId"].value;
  if (x == null || x == "") {
      alert("SPCR ID must be filled out");
      return false;
  }
  }
  </code></pre>
  
  <p>What is the way to disable form validations for "Cancel" button?</p>