JavaScript DHTML/Event onMethod/onBeforePrint
"onBeforePrint" Example
<source lang="html4strict">
<head> <script language="JavaScript">
function function1() { window.print(); }
</script> </head> <body onbeforeprint="alert("This page is about to be printed")">
Some body Content to print.
<input type="button" value="Print" onclick="function1()">
</body> </html>
</source>