title: I try to implement Sweet Alert to Node.js delete form
body: <p>I'm trying to implement Sweet Alert to Node.js delete form, but unfortunately the alert doesn't work properly. It only pops up for a second and without clicking on delete button on the alert window, it deletes file from DB.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;form action="/comicbooks/&lt;%= comicbook._id %&gt;/?_method=DELETE" 
    method="POST" class="deleteForm" onsubmit='swal({
    title: "Are you sure?",
   text: "Your will not be able to recover this imaginary file!",
   type: "warning",
   showCancelButton: true,
   confirmButtonClass: "btn-danger",
   confirmButtonText: "Yes, delete it!",
   closeOnConfirm: false,
   showLoaderOnConfirm: true,
   },
  function (isConfirm) {
   location.reload();
  });'&gt;  
  &lt;button class="btn btn-xs btn-danger"&gt;Delete&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Coul you please assist?</p>
  
  <p>Many thanks in advance,
  Szymon</p>