How to use confirm (then submit) using sweet alert?
<p>I have a table where each row have a delete button with this form</p>

<pre><code>&lt;form id="tableDelete_1"&gt;
 &lt;input type="hidden" name="tipo" value="delete" /&gt;
 &lt;input type="submit" name="send" value="Delete" class="btn btn-danger btn-xs" onClick="return confirm(`Are you sure?`)" /&gt;
&lt;/form&gt;

&lt;form id="tableDelete_2"&gt;
 &lt;input type="hidden" name="tipo" value="delete" /&gt;
 &lt;input type="submit" name="send" value="Delete" class="btn btn-danger btn-xs" onClick="return confirm(`Are you sure?`)" /&gt;
&lt;/form&gt;
</code></pre>

<p>Then this on bottom of the page</p>

<pre><code>$(document).on('submit', '[id^=tableDelete_]' , function() { 
 return callAjax( $(this).serialize() ); 
});

function callAjax( data ) {
  $.ajax({
   type : 'POST',
   url  : 'call/page.php',
   data : data,
   success :  function(data) { ... },
   error: function(data) { ... }
  });
  return false;
 };
</code></pre>

<p>Now I want to delete the classic </p>

<pre><code>onClick="return confirm(`Are you sure?`)"
</code></pre>

<p>and use sweetalert...
I have problem just at start when I want to show only the popup with this function</p>

<pre><code>$(document).on('submit', '[id^=tableDelete_]' , function() { 
 swal({
  title: "Are you sure?",
  text: "You will not be able to recover this imaginary file!",
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  confirmButtonText: "Yes, delete it!",
  closeOnConfirm: false
 },
 function(){
  swal("Deleted!", "Your imaginary file has been deleted.", "success");
 });
};
</code></pre>

<p>The popup is showed only for a second then the page is reloaded because I think the form is submitted...</p>

<p>Please give me help</p>