title: One HTML form with multiple submit buttons for different tasks
body: <p>I have found many posts that do the opposite of what I am attempting, but none for this situation. What I currently have (working):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function dotask1(a, b) {
  window.open('internal.website.com/' + a + '+' + b', 'awindow');
  }&lt;/script&gt;
  
  &lt;form onsubmit="dotask1(this.a.value, this.b.value); return false;"&gt;
  &lt;input type="text" name="a" placeholder="First Name" /&gt;
  &lt;input type="text" name="b" placeholder="Last Name" /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
  function dotask2(c, d) {
  window.open('internal.website.com/' + c + '+' + d', 'bwindow');
  }&lt;/script&gt;
  
  &lt;form onsubmit="dotask2(this.c.value, this.d.value); return false;"&gt;
  &lt;input type="text" name="c" placeholder="First Name" /&gt;
  &lt;input type="text" name="d" placeholder="Last Name" /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This allows me to enter a first and last name into each of two forms and submit. I want to have only one form and two different submit buttons that will each have a separate task. I appreciate any help.</p>
  
  <p>EDIT:</p>
  
  <p>Peter advises to go with onclick, which makes sense. I have the following, which will not work, any thoughts on my error(s)?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function dotask1(a, b) {
  window.open('internal.website.com/' + a + '+' + b', 'awindow');
  }
  function dotask2(c, d) {
  window.open('internal.website.com/' + c + '+' + d', 'bwindow');
  }
  &lt;/script&gt;
  
  &lt;input type="text" name="a" placeholder="First Name" /&gt;
  &lt;input type="text" name="b" placeholder="Last Name" /&gt;
  &lt;input type="button" onclick="dotask1(this.a.value, this.b.value); return false;"/&gt; /&gt;
  &lt;input type="button" onclick="dotask2(this.a.value, this.b.value); return false;"/&gt; /&gt;
  &lt;/form&gt;
  </code></pre>