Closed brkbzdg94 closed 5 years ago
I want OK button click then after, return a value. how can i do this?
function mySwalAlert(atitle, atext, atype) { var rtn = null; swal({ title: atitle, text: atext, type: atype, showCancelButton: true, confirmButtonColor: "#EF5350", confirmButtonText: "Evet!", cancelButtonText: "Hayır", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { rtn = 1; } else { rtn = 0; } }); if (rtn == 1) return true; else return false; }
But always return false. Because firstly function(isConfirm){ } run
It looks like you're using an old version of the library. Take a look at the upgrade guide
I want OK button click then after, return a value. how can i do this?
function mySwalAlert(atitle, atext, atype) { var rtn = null; swal({ title: atitle, text: atext, type: atype, showCancelButton: true, confirmButtonColor: "#EF5350", confirmButtonText: "Evet!", cancelButtonText: "Hayır", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { rtn = 1; } else { rtn = 0; } }); if (rtn == 1) return true; else return false; }
But always return false. Because firstly function(isConfirm){ } run