Hi,
the solution is very simple:
1. Give your print button an ID:
<input id="printpagebutton" type="button" value="Print this page" onclick="printpage()"/>
2. Adjust your script the way that it hides the button before calling
window.print()
:
<script type="text/javascript">
function printpage() {
var printButton = document.getElementById("printpagebutton");
printButton.style.visibility = 'hidden';
window.print()
printButton.style.visibility = 'visible';
}
</script>
Fast 'n' nice.
cheers,
Marco