So why would the close button and routine no longer work?
Here is the close button code:
<input type=button value="Close" onClick="javascript:closeWindow();">
It was because the javascript came up with an error:
Here is the function which was stored in the form's "JS Header" area:
function closeWindow(){
window.opener.rdocprintClosed=true;
window.opener.docprintClosed=true;
window.close()
}
The code above never got to the window.close() as the lines above failed.
here is the code I changed to:
function closeWindow(){
op=window.opener;
if (op && op.open && !op.closed) window.opener.rdocprintClosed=true;
if (op && op.open && !op.closed) window.opener.docprintClosed=true;
window.close()
}
Why the three checks?
The checks make sure the window pointer exists, the window was open at some point and the window is not closed.