supress Printing 'print' link

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello folks,

I havea link with a href of javascript:window.print()

it works fine except that it prints the 'Print' link itself......

anybody know how I can supress printing the link?



Re: supress Printing 'print' link

Quoted text here. Click to load it

Configure your browser to not print the 'Print' link.

F1 will help.


Re: supress Printing 'print' link

Quoted text here. Click to load it

And except that it doesn't work when JavaScript isn't available and is
a dead link instead.

And except that it produces a new and unexpected UI control for
something that the typical browser already presents the user with
several ways of doing (File > Print, Ctrl+P, a print button in a
toolbar, etc).

It is pointless. It doesn't allow users to do anything they couldn't
do before, breaks in some cases, and wastes screen space and

Quoted text here. Click to load it

Best way - get rid of it. Otherwise set up a print media stylesheet.

David Dorward / /

Re: supress Printing 'print' link

Quoted text here. Click to load it

Hi David,

The HTML Police will probably moan but this is how I do it...

<title>Test Page</title>

<script language="JavaScript" type="text/javascript">
function hideprintbutton(){'none';'inline';
function showprintbutton(){'none';'inline';
// - End of JavaScript - -->

<body onclick="showprintbutton()">

<span id="printon" style="display: inline"><a href="javascript:
hideprintbutton(); window.print()" title="Click here to PRINT this page"
hidefocus><img src="../images/input/print_button.gif" width="80" height="80"

<span id="printoff" style="display: none"><img
src="../images/input/print_button_mask.gif" width="80" height="80"
title="Click anywhere to restore the PRINT button"></span>


Hope this helps


Site Timeline