I am using sweetalert2 library for showing alert in my code.
ConfirmationMessage = function(msg) {
swal({
title: "",
text: msg,
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Ok",
cancelButtonText: "Cancel",
closeOnConfirm: false,
closeOnCancel: false,
allowEscapeKey: true
});
}
This is the JS function and I am using it at other place.
if (!ConfirmationMessage("message to show.")) {
alert("if");
}
else {
alert("else");
}
My issue is
I want to stop the control when the alert is on screen and want to decide on the button push if OK come to If Condition if Cancel come to else condition but control does not wait for the response in sweetalert2.