title: How to make submit and save button work on jsp page?
body: <p>I am creating a form..i want my form to have two buttons one for "submit" and the other for "Save as draft".when I click on submit the data has to be submitted and when I click on save it should show the filled form on another page.I know how to submit and save independently but how do I make them work in the same form.my code is as follows</p>
  
  <pre><code>&lt;form method="post" action="submitpage.jsp" &gt;//I want here in action to change according to the button clicked
  &lt;table border="2" &gt;
  &lt;tr&gt;
  &lt;td&gt;Field 1&lt;/td&gt;
  &lt;td&gt;&lt;input  type="text" style=" width: 150px; height: 15px" value="" name="Field1"  id="F1"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Field 2&lt;/td&gt;
  &lt;td&gt;&lt;input  type="text" style=" width: 150px; height: 15px" value="" name="Field2"  id="F2" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Field 3&lt;/td&gt;
  &lt;td&gt;&lt;input  type="text" style=" width: 150px; height: 15px" value="" name="Field3"  id="F3" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;td&gt;Field 4&lt;/td&gt;
  &lt;td&gt;&lt;input  type="text" style=" width: 150px; height: 15px" value="" name="Field4"  id="F4" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" value="Submit" onclick="return js_file_for_validation()" autofocus="autofocus"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="button" value="Save as draft" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;&lt;/form&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>P.s:-I AM USING JAVASCRIPT FOR VALIDATING SUBMIT!!!!
  IS there anything that I have to write in js file ??? Guidance will be helpful!!</p>
  
  <p>Thanks in adv!!</p>