lunchbox88
Programmer
If I want to have a "Print" button on my page, but don't want it to show on the printed page, is that possible?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<script language="javascript">
<!--
function PrintMe()
{
document.Form1.btnSave.style.visibility = "hidden";
window.print();
}
//-->
</script>
'TURN ON THE PRINTING SCRIPT !
btnSave.Attributes.Add("onClick", "PrintMe()")
<script language=javascript>
function window.onbeforeprint(){
// hide element(s)
document.getElementById("myButton").style.display = "none";
}
function window.onafterprint(){
// show element(s) after printing is done
document.getElementById("myButton").style.display = "block";
}
</script>