what to do if we want javascript to be executed first then the php post method i.e submitting
<p>For example: I want to accept or reject a photo.</p>

<p>The input button for accept and the form is:</p>

<pre><code>&lt;form method="post" action="viewRequests.php"&gt;
    &lt;input type="submit" onClick="showAlertBox()"&gt;
&lt;/form&gt;
</code></pre>

<p><code>showAlertBox()</code> is a javascript function which shows a confirmation dialog with <em>Yes</em> or <em>No</em>. If I choose <em>No</em> then the form submission should not be triggered.</p>

<p>what to do in this case</p>
