HTML:
<input type="submit" class="general-btn" value="Submit" name="decision" id="trigger">
First JS call:
$("#trigger").submit(function (e) {
userSubmit(e);
});
Then I followed this fiddle from jQuery Deferred and Dialog box
function userSubmit(e){
var question = "Do you want to start a war?";
confirmation(question).then(function (answer) {
console.log(answer);
var ansbool = (String(answer) == "true");
if(ansbool){
alert("this is obviously " + ansbool);//TRUE
} else {
alert("and then there is " + ansbool);//FALSE
}
});
}
but the form is submitting before the confirmation is answered.