title: BootstrapDialog.Confirm Not Waiting Before Submission
body: <p>I'm using Bootstrap Dialog to show the user a nicely styled confirm box before they delete a message. Therefore, I have something like</p>
  
  <pre><code>&lt;form onsubmit='return confirmDelMsg()'&gt;
  ...
  &lt;/form&gt;
  </code></pre>
  
  <p>The javascript function:</p>
  
  <pre><code>function confirmDelMsg() {
      BootstrapDialog.confirm('Are you sure you want to delete this message?', function(result) {
           return result;
       });
  }
  </code></pre>
  
  <p>The thing is this confirm pop-up appears for a millisecond but doesn't wait for me to click yes or no. Then the message is deleted anyway.</p>
  
  <p>So how can I fix this issue?</p>
  
  <p>This is the library I'm using: Btw, is it called a library or a framework, this BootstrapDialog?</p>
  
  <p><a href="https://nakupanda.github.io/bootstrap3-dialog/" rel="nofollow">https://nakupanda.github.io/bootstrap3-dialog/</a></p>
  
  <p>Do you know of any other libraries such as this one? I know about <code>bootbox.js</code> too but it has the same error...</p>
  
  <p>EDIT:</p>
  
  <pre><code>function confirmDeleteMsg() {
      return BootstrapDialog.confirm("Are you sure you want to delete this message?", function(result) {
         if (result) {
             var deleteMsgForm =  document.getElementById('deleteMsgForm');
             if (typeof(deleteMsgForm) != 'undefined' &amp;&amp; deleteMsgForm != null) {
                alert("HERE"); // this here is executing!!!
             }
             deleteMsgForm.submit(); // this is not executing?! why?
          }
      });
  }
  </code></pre>