Hi just a quick question.

I have a block of code to stop a user double clicking button (adapted from a double form submit blocker).

Simple question really, the code seems to work but, nothing in the else block gets run!! Therefore the I can't pop up a message to tell the user they have allready told it to open the print window etc..


-Daz

------------------------------------------------------------------------------------
Code is as follows:


code in included page
------------------------------
<script language="JavaScript">
function clsFormSubmission() {
var bFormPosted = false;
this.docTitle = false;
this.docStatus = false;
this.canSubmit = function() {
if (bFormPosted) {
return false;
} else {
bFormPosted = true;
if (this.docTitle) { document.title = this.docTitle; }
if (this.docStatus) { document.status = this.docStatus; }
//alert('Posted. thanks...');
return true;
}
};
}
var oFrmSubmission = new clsFormSubmission();
oFrmSubmission.docTitle = 'The page is currently loading, Please wait...';
</script>


code in main page
------------------------
<script>
function canPrint()
{
canPrint = function() {oFrmSubmission.canSubmit();};
if (canPrint)
{
alert("Can Print");
stockPrintWin('control.cfm?MREQ=app_stockListPrint ');
}
else
{
//this bit doesn't appear to get called
alert("Can't Print");
}
}
</script>