Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q1403

Feedback on: irt.org FAQ Knowledge Base Q1403

Sent by Jurriaan Balleur on July 17, 2000 at 03:19:05: - feedback #1497

Comments:
It doesn't work. When I push the print button. The print menu will appear. I print the document but the button still appears on the printed document ?????

Can someone help me ?


Sent by Jon Speechley on January 23, 2002 at 10:46:37: - feedback #3515

Worth:
Worth reading

Length:
Just right

Technical:
Just right

Comments:
Create a button which resides in a division, which is hidden upon clicking then unhidden after the print operation, thus:

<html>
<head>
<script language="javascript">

</head>
<body>
Click button to print this screen.
<div id="printbutton">
<button onclick="PrintWithoutButton('printbutton')">Print Screen</button>
</div>
</body>
</html>


Sent by Andrew Johnson on April 24, 2002 at 04:17:31: - feedback #3806

Worth:
Worth reading

Technical:
Too technical

Comments:
Another method...

<SCRIPT LANGUAGE=javascript>

</SCRIPT>

<FORM name="frmButtons" action="">
<INPUT type="button" name="btnAddEntry" value="Add a new task"> 
<INPUT type="button" name="btnBack" value="Back"> 
<INPUT type="button" name="btnPrint" onClick="Javascript: doPrint()" value="Print">
</FORM>


Sent by Andrew Johnson on April 24, 2002 at 04:18:00: - feedback #3807

Worth:
Worth reading

Technical:
Too technical

Comments:
Another method...

<SCRIPT LANGUAGE=javascript>

function doPrint()
{

document.frmButtons.btnAddEntry.style.visibility = 'hidden'
document.frmButtons.btnBack.style.visibility = 'hidden'
document.frmButtons.btnPrint.style.visibility = 'hidden'

window.print()

document.frmButtons.btnAddEntry.style.visibility = 'visible'
document.frmButtons.btnBack.style.visibility = 'visible'
document.frmButtons.btnPrint.style.visibility = 'visible'
}

</SCRIPT>

<FORM name="frmButtons" action="">
<INPUT type="button" name="btnAddEntry" value="Add a new task"> 
<INPUT type="button" name="btnBack" value="Back"> 
<INPUT type="button" name="btnPrint" onClick="Javascript: doPrint()" value="Print">
</FORM>


Sent by Kelson on Wednesday April 25, 2007 at 18:25:53 - feedback #4489

Worth:

Length:

Technical:

Comments:
In modern browsers, this is simple with CSS. Assign the button a class, say
<INPUT class="noprint" type="button" name="btnPrint" onClick="Javascript: doPrint()" value="Print">

Then in your stylesheet, include the following:

@media print {
.noprint {display:none}
}

You can add the same class to anything else that you want to hide during printing.




©2018 Martin Webb