function Globally() {
$("#dialogid").dialog({ width: 300, modal: true, show: 'drop', hide: 'drop',
buttons: {
"Ok": function () { return true; $(this).dialog('close'); },
"Cancel": function () { return false; $(this).dialog('close'); }
}
});
}
function test()
{
if(Globally())
alert("Ok");
else
alert("Cancel");
}
I am trying to make a confirmation dialog and I want it to placed in a function (in this case Globally()) because I am using confirmation dialog in so many different function, but this is not working , the control returns from the Globally()
function without getting true or false
value. I want it to stop there until user press Ok or Cancel
. How can I do this?