onclick Button Event with Confirm Dialog Box
<p>This code is from a PHP software (using Smarty template engine) and it works:</p>

<pre><code>    &lt;input type=\"button\" class=\"btn btn-primary\" value=\"{$LANG["phrase_send_email"]}\" onclick=\"ms.edit_submission_page_send_email($submission_id); this.disabled=true;\" /&gt;";
</code></pre>

<p>A user clicks on the button and the software will:</p>

<ul>
<li>send an email to the recipient</li>
<li>the button is disabled to prevent multiple emails being sent by accidentally clicking it more than once</li>
</ul>

<p>I want it to do more: adding a popup confirmation dialog box. The purpose is to remind the human to do something first by reading the text message in the confirmation dialog box before sending an email.</p>

<p>So if the user clicks OK:</p>

<ul>
<li>execute button function</li>
<li>disables button</li>
</ul>

<p>or if the user cancels:</p>

<ul>
<li>dialog box cancels and no email function executes. Return to screen.</li>
</ul>

<p>There are plenty of JavaScript <em>if else/confirm</em> examples. But I'm new to JavaScript and have no idea how <em>ms.edit_submission_page_send_email($submission_id)</em> fits into the JavaScript world.</p>

<p>How would one put all of this into a JavaScript function?</p>