title: Confirm form submission using bootbox.confirm()
body: <p>I have a form and want to intercept form submission to display a confirmation dialog using <a href="http://bootboxjs.com/" rel="nofollow noreferrer">bootbox</a>.</p>
  
  <ol>
  <li>User enters some data</li>
  <li>User hits submit</li>
  <li>A confirmation dialog is shown</li>
  </ol>
  
  <p>If the user hits <code>OK</code>, then the form should submit, if not it should just stay on the page.</p>
  
  <p>I tried this:</p>
  
  <pre><code>$('#myForm').submit(function() {
      return bootbox.confirm("Are you sure?");
  });
  </code></pre>
  
  <p>However, <code>bootbox.confirm()</code> immediately returns, the confirmation dialog is hidden again.</p>
  
  <p>I then noticed that there is a callback parameter on <code>bootbox.confirm()</code>. However, if I'm to call <code>$('#myForm').submit()</code> from the callback, this will obviously just show the confirmation dialog again.</p>
  
  <p>So what is the proper way to confirm form submission?</p>