title: onchange="this.form.submit()" versus two submit buttons
body: <p>With a pulldown triggering an onchange event to submit, it fails to work when two input submit buttons are present. It makes sense, so how do you specify exclusively which submit button to process?</p>
  
  <pre><code>&lt;form&gt;
  &lt;select onchange="this.form.submit()"&gt;&lt;/select&gt;
  &lt;input type="submit" name="submit1" id="submit1" value="Submit 1" /&gt;
  &lt;input type="submit" name="submit2" id="submit2" value="Submit 2" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Solution</strong>
  Using the suggestion from below, this code will work so that the second submit button will execute if the onchange is trigged from the pulldown:</p>
  
  <pre><code>&lt;form&gt;
  &lt;select onchange="var e=document.getElementById('killbox'); var s=document.getElementById('submit1'); e.removeChild(s); this.form.submit();"&gt;&lt;/select&gt;
  &lt;div id="killbox"&gt;&lt;input type="submit" name="submit1" id="submit1" value="Submit 1" /&gt;&lt;/div&gt;
  &lt;input type="submit" name="submit2" id="submit2" value="Submit 2" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is in a basic form, certainly doesn't hurt to throw the Javascript in to a function instead of using inline Javascript for the onchange.</p>