Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ok I have a page that has a link th

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
Ok I have a page that has a link that will open a print version page on top of that window. I want to put a back button on the print version page, but I don't want the back button to print.

How would I go about that.

This is the code for the print version window.

<HTML>
<HEAD>
<TITLE>Print page<TITLE>
<BODY onload = &quot;printForm()&quot;>
<center>
Body stuff.......
<form>
<INPUT TYPE=&quot;button&quot; NAME=&quot;EXIT&quot; VALUE=&quot;Exit&quot;
onClick = &quot;canit();&quot;>
</form>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function printForm(){
window.print();
window.close();
}
function canit()
{
document.close();
window.top.location=&quot;{
</SCRIPT>
</BODY>
</HTML>


Thanks as always for your expertise!!!!!,

Scott
 
try using a href instead of a button - this won't reload the page = it won't print the page (as the page prints when it loads)

<HEAD>
<TITLE>Print page<TITLE>
<BODY onload = &quot;printForm()&quot;>
<center>
Body stuff.......

<a href=&quot; target=top> click me to exit </a>
...
or alternatively you can change both locations in the canit function (top and current) - so that current frame load another page - thus won't reload = won't print
 
Thanks for your reply, but I already have that code in place. What I am trying to do is hide the href or button if you will from being printed. I want it to be visible and functional but not printed on the paper report.

Thanks again for your help,

Scott
 
ok ! i didn't understand your explanation !!
just use the @media tag froom css and specify that the layer/div/whatever containing the button has to be hidden when media=print
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top