title: JavaScript Form Submit - Confirm or Cancel Submission Dialog Box
body: <p>For a simple form with an alert that asks if fields were filled out correctly, I need a function that does this:</p>
  
  <ul>
  <li><p>Shows an alert box when button is clicked with two options:</p>
  
  <ul>
  <li>If "OK" is clicked, the form is submitted</li>
  <li>If cancel is clicked, the alert box closes and the form can be adjusted and resubmitted</li>
  </ul></li>
  </ul>
  
  <p>I think a JavaScript confirm would work but I can't seem to figure out how.</p>
  
  <p>The code I have now is:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function show_alert() {
    alert("xxxxxx");
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form&gt;
    &lt;input type="image" src="xxx" border="0" name="submit" onclick="show_alert();" alt="PayPal - The safer, easier way to pay online!" value="Submit"&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>