Intercept delete button press - cancelling in confirmation does nothing
<p>I asked a similar question recently:</p>

<p><a href="http://stackoverflow.com/questions/9010830/i-want-to-intercept-a-delete-button-press">I want to &quot;intercept&quot; a delete button press</a></p>

<p>Basically I am trying to intercept a delete button press. I can get a confirmation using <code>confirm("Are you sure?")</code> in an <code>onclick=</code>, however, no matter what I choose, ok or cancel, it still proceeds to delete the item I clicked delete on.</p>

<p>How do I prevent this?</p>

<p>My code looks like this:</p>

<pre><code>'&lt;td&gt;&lt;button type="submit" name="del" onclick="confirm(\'Are you sure?\')" value=' . stripslashes($servrow["serv_id"]) . '&gt;Del&lt;/button&gt;&lt;/td&gt;
</code></pre>

<p>How do I make it so that clicking cancel doesn't delete the item!</p>

<p>(If anyone needs me to convert the interspersed PHP into just HTML, let me know, I'd be happy to, to increase understanding of my problem)</p>
