title: Submit form to new window only when specific submit button is pressed?
body: <p>I have a form, which has a few different submit buttons on it all doing different things with the same post data.</p>
  
  <p>Lets say for simplicity sake the form looks like this:</p>
  
  <pre><code>&lt;form method="post"&gt;
    &lt;input type="hidden" name="ids" value="1,2,3,4" /&gt;
    &lt;input type="submit" id="picking" name="picking" value="Picking" /&gt;
    &lt;input type="submit" id="shipping" name="shipping" value="Shipping" /&gt;
    &lt;input type="submit" id="invoice" name="invoice" value="Invoice" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>At the moment the form submits to itself and I work out server side which submit button is pressed, build a URL from the POST data, then do a PHP redirect to what I need to go. This works fine.</p>
  
  <p>However, I am looking for the form to post its data to a new window, but only when  "invoice" is clicked. This rules out just adding <code>target="_blank"</code> to the form, as the other 2 buttons would submit to new pages as well.</p>
  
  <p>I also can't split the form into 3 different forms as the data is a lot more complex than the above, and a lot of it is input by the user.</p>
  
  <p>Is there a way to do this using JavaScript/JQuery? If so, where would I start?</p>
  
  <p>Thanks</p>