Add a Print Button to a page

G

Guest

Please can anyone tell me how to add a print button & icon to a Frontpage
page so when clicked, the user prints the page he is on, without needing to
go to the print button oon the main toolbar.
It may seem a very basic question, sorry!
 
M

Murray

However it fails in Mac/IE5, I believe. As far as I know, this is the best
you can do -

Put this in the head of the document -

<script type="text/javascript">
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}
</script>

Put this in the body of the document -

<a href="javascript:print_page()">Print this</a>
 
G

Guest

Murrar & Kathleen, many thanks to you both.
Mick

Murray said:
However it fails in Mac/IE5, I believe. As far as I know, this is the best
you can do -

Put this in the head of the document -

<script type="text/javascript">
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}
</script>

Put this in the body of the document -

<a href="javascript:print_page()">Print this</a>
 
H

Hot-text

<!-- Paste this code into the STYLE section of your HTML document
so the button itself will not print -->

<style type="text/css">
<!--
@media print {
input.noPrint { display: none; }
}

-->
</style>

<!-- Paste this code into the BODY section of your HTML document -->

<input class="noPrint" type="button" value="Print This Page"
onclick="window.print()">
</body>


it work good if you put I in the STYLE like this!!!!!1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top