Confirm

Sorry but I just do not understand how to use confirm with if. :nerd:

dhtmlx.message({ type:"confirm", text: "Continue?", callback: function(mode) var test = mode; //mode==true if OK button was pressed, false otherwise alert(test); //why no alert with true oder false popup? } });

:mrgreen:

I have found the following solution:

[code]dhtmlx.confirm(“ok?”,function(result){
if (result) ok();
else cancel();
});

function ok() {
alert (“ok”);
}

function cancel() {
alert (“cancel”);
}

[/code]

But how can I use this version?

dhtmlx.confirm({
		title: "Close",
                type:"confirm-warning",
		text: "Are you sure you want to do it?",
		callback: function() {dhtmlx.confirm("Test confirm");}
});

Yes, you can: callback gets true or false as a parameter