Closed mandricmihai closed 9 years ago
That's the downside to custom confirms. They don't work the same as the built-in one javascript supplies. You have the use the onConfirm and onDeny callbacks. The best way if you want a custom question is:
$.fn.jAlert.defaults.confirmQuestion = 'Do you want to add this?';
confirm(
function(e, btn){ //onConfirm
e.preventDefault();
//do something here
btn.parents('.jAlert').closeAlert();
return false;
}, function(e,btn){ //onDeny
e.preventDefault();
//do something here
btn.parents('.jAlert').closeAlert();
return false;
}
);
or
$.jAlert({
'type': confirm',
'confirmQuestion': 'Do you want to add this?',
'onConfirm': function(e, btn){
e.preventDefault();
//do something here
btn.parents('.jAlert').closeAlert();
return false;
},
'onDeny': function(e, btn){
e.preventDefault();
//do something here
btn.parents('.jAlert').closeAlert();
return false;
}
);
oh thanks know its working as intended great plugin :+1:
thank you!
this is my actual confirm using build in browser
and then I do if (confirm() == true) how to make this with jAlert?