In this code form is submitted even i am clicking on no
document.querySelector(\'#from1\').onsubmit = function(){
 swal({
    title: \"Are you sure?\",
             
        
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!"
 }).then(
       function () { /*Your Code Here*/ },
       function () { return false; });