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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print link in a popup window? 1

Status
Not open for further replies.

JennyW

Technical User
Mar 1, 2001
323
CA
Hi.

Is there a way I can put a print link on a popup window?
Like, can that print link activate the printer and print the info inside the popup?

If possible, I am looking for something that works in both IE and Netscrap.


Thanks.
Jenny
 
hi Jenny,

This will work in IE5+ (not IE4 and not NN4+) I don't know about NN6, but I think it does.

The alertbox in the "else" will tell the users with older browsers how to print manually.

----put this code in the popup file------------

<script language=&quot;javascript&quot;>
function PrintPage() {
if (window.print)
{
window.print();
}
else
{
alert('Your browser does not support automatic printing.\nPlease select &quot;Print&quot; from the file menu\n\nor press Ctrl + P');
}
}
</script>

<a href=&quot;javascript:printPage()&quot;>print this page</a>

-------------end code------------

Hope this helps,
Erik
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Hia Boomer!

Thanks for the help. It worked great!
I successfully tested it in IE 5.0 and NS 4.7.

Thanks again :)
Jenny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top