Crystal Rouse
asked on
Using isConfirm with a SweetAlert
I have a SweetAlert with a Cancel option. My javascript has the isConfirm function and works correctly if isConfirm is true. It just bypasses the code for the else statement. Any thoughts?
swal({
title: "Add New Action/Task",
text: "This will add a new Action/Task to the stored Action List for future use. If you do not wish to save this Action for later, click Cancel and choose Other.",
type: "warning",
showCancelButton: true,
cancelButtonText: "Cancel",
buttons: true,
dangerMode: true,
closeOnConfirm: true,
closeOnCancel: true,
confirmButtonText: "Yes"
},
function (isConfirm) {
if (isConfirm) {
CM.disabled = false;
CM.style.backgroundColor = "white";
actionOther.style.backgroundColor = "white";
actionOther.placeholder = "Enter New Action/Task";
}
else {
CM.disabled = false;
actionDropdown.value = "Other";
actionDropdown.text = "Other (Enter Other Action/Task)";
actionOther.placeholder = "Enter Other Action/Task";
}
}.bind(this));
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I fixed it myself. Simply replaced: }.bind(this));
with });
with });
ASKER
I fixed it myself. Simply replaced: }.bind(this));
with });
with });
ASKER
I fixed it myself. Simply replaced: }.bind(this));
with });
with });
sweetAlert is used in older versions.
ASKER