title: How to use confirm using sweet alert?
body: <p>In this code form is submitted even i am clicking on no</p>
  
  <pre><code>document.querySelector('#from1').onsubmit = 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, I am sure!',
      cancelButtonText: "No, cancel it!",
      closeOnConfirm: false,
      closeOnCancel: false
   },
   function(isConfirm){
  
     if (isConfirm){
       swal("Shortlisted!", "Candidates are successfully shortlisted!", "success");
  
      } else {
        swal("Cancelled", "Your imaginary file is safe :)", "error");
      }
   });
  };
  </code></pre>