Set up the onbeforeunload option to call the 'disableButtons()' function. It will disable the buttons after the action has been initiated, yet cause the appropriate code to execute in the code behind. If you disable a button prior to the onbeforeunload event, then the code behind will NOT receive that the button has been clicked event, because it was disabled before evoking that event.
[code]
<body class="formStyle" onbeforeunload="disableButtons();">
var ButtonsToDisable = [];
{
var btnCSV = document.getElementById("btnCSV");
var btnSearch = document.getElementById("btnSearch");
ButtonsToDisable.push(btnCSV);
ButtonsToDisable.push(document.getElementById("btnSearch"));
if (typeof vButton === 'undefined')
{
return true;
}
if (vButton == null)
{
return true;
}
if (vButton == 'CSV')
{
btnCSV.innerText = "Working";
}
return true;
}
[/code]
No comments:
Post a Comment