How to use jQuery to submit a form and specify which submit button to use
<p>Suppose a form has multiple submit buttons:</p>

<pre class="lang-html prettyprint-override"><code>...
&lt;button type="submit" value="deletefoo"&gt;Delete Foo&lt;/button&gt;
&lt;button type="submit" value="deletebar"&gt;Delete Bar&lt;/button&gt;
&lt;button type="submit" value="Edit"&gt;Edit&lt;/button&gt;
...
</code></pre>

<p>I am intercepting the clicks for only the 2 delete buttons and disabling the form submit to trigger a custom modal dialog which has OK and CANCEL buttons on it to confirm user choice. If user presses OK, I want to submit the form.  If cancel, then dialog dismissed and nothing happens.</p>

<p>I have the first part wired up to trigger the dialog but I am at a loss on how to get the OK button in the dialog to trigger the form submit contingent on which original submit button was pressed (e.g. if <code>Delete</code> button pressed, I want to confirm with user they want to delete, then if so, submit the form as normal.</p>

<p>I've searched around and look at jQuery docs but haven't found the answer yet so I must be missing something really straightforward.</p>

<p><strong>Update:</strong> I don't want to use JS confirm function. In my original question above I'm looking to use a custom modal dialog for various reasons.</p>
