Here is my code where i am using sweetalert latest code for showing up a confirmation just like a javascript confirm box to act if ok, is pressed adn if its a cancel, do nothing,
Here is my try and my original code
var rtrnval = swal({
title: "Check!",
text: "You must select a task before entering hours.",
type: "warning",
showCancelButton: true,
confirmButtonColor: "##DD6B55",
confirmButtonText: "Confirm",
closeOnConfirm: false
}, function(isConfirm){
return isConfirm; //Will be either true or false
});
alert(rtrnval); return;
my original code is like this
var rtrnval = confirm("You must select a task before entering hours.");
it is not showing the sweetalert box when i change confirm to swal, it throws error on the function but when i use confirm, the function works properly,
i am unable to read the value being returned to me like true/false so i ca act upon it
any guidance, greatly appreciated
i already posted code what i tried
here is what i want to replace
function ConfirmDelete(id){
var rtrnval = confirm("are you sure!!");
if (rtrnval == 1)
{
location='page2.php='+id
}
return 0
}
and some cases i am doing this
return confirm("are you sure")