I have an onClientClick event like so:
OnClientClick="return getErrors();"
- this of course is within an
the body of the function is:
function getErrors() {
var errorString = "some errors";
return $('<div id="dialog-message" title="Required"><p>' + errorString + '</p></div>').dialog(
{
modal: true,
width: 700,
buttons:
{
Ok: function () {
$(this).dialog("close");
return callback_ErrorAction(0);
},
Cancel: function () {
$(this).dialog("close");
return callback_ErrorAction(1);
}
}
});
return false; //omit this and OnClientClick gets undefined response variable
}
Also the callback function is defined as:
function callback_ErrorAction(bool)
{
if (bool == 0) {
return true;
}
else if (bool == 1) {
return false;
}
}
The problem is I need the OnClientClick response to be based on user response, clicking Ok or cancel but the current solution returns a response to onClientClick before the user even has a chance to select OK or Cancel. Thanks for helping