I'm not good with this JavaScript custom confirm box.
What I want: Custom Confirm Box {popup showing images & styled text}
Why I'm asking: I have conditions, on that custom confirm Box will shown, On this custom confirm Box value, I have further condition. That's why I stuck here!
My code:
var infoBox = false;
if (msgType=='1'){
alert(msg);
infoBox=confirm("Test1");
} else if(msgType=='2'){
customConfirmBox(function(){
alert(infoBox);
});
} else {
infoBox=confirm("Continue?");
}
if (infoBox){
//code
alert('done');
}
function customConfirmBox(callback){
$('.confirmMsg').show();
$('#alertAccepted').click(function() {
input_box=true;
callback();
});
}
What happening with this code: when msgType is 2, it shows popup proper, but then nothing happens, Its not waiting for user input like confirm (') ;
How can I solve it;