swal({title: "Are you sure?", text: "Your form will be submitted", confirmButtonText: "Ok",
showConfirmButton:true, showCancelButton: true, cancelButtonText: "No", type:"warning", closeOnConfirm: false,
closeOnCancel: false },
function(isConfirm) {
if (isConfirm) {
swal({
title: 'Confirm!',
text: 'Successfully Submitted!',
type: 'success'
}, function() {
console.log("Inside Function");
$scope.applyleave("ok");
});
} else {
swal("Cancelled", "Your application not submitted :)", "error");
return false;
}
});
The code flow should only continue after clicking 'Ok', but it currently executes without any user action.
I am submitting the form from HTML to this JS, but I want to block the confirmation box and wait for user action. I want to allow the below code to execute only when the user presses 'Ok'.