title: Add a confirmation alert before submitting a form
body: <p>I have a form which allows the user to delete some data from a database.</p>
  
  <p>I want to have a bit of confirmation to prevent accidental deletes. I want to do the following:</p>
  
  <ol>
  <li>When submit is pressed, alert pops up with "Are you sure?"</li>
  <li>If user hits "yes" then run the script</li>
  <li>If user hits "no" then don't submit the script.</li>
  </ol>
  
  <p>How can this be done? </p>
  
  <p>I have added the onSubmit alert but it does not show anything, and it still submits the form. How can I delay the submission of the form to only occur when the user selects "yes" from the alert?</p>
  
  <pre><code>&lt;form 
    method="POST"
    action="actions/remove-daily-recipient.php"
    onSubmit="alert('Are you sure you wish to delete?');"
  &gt;
    ...
  &lt;/form&gt;
  </code></pre>