Print Button

G

Guest

Is it possible to place a "print" button on a page that when clicked only
prints a certain part of the page. i.e. "Click here to print the terms and
conditions"
 
T

Thomas A. Rowe

No, unless you have the button linked to a page with just the content to be printed.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
M

Murray

Yes - provided you use a print media stylesheet.

The stylesheet would turn everything off except for the T&C section. This
assumes that you have built your page anticipating such usages.

To see what I mean, go here - http://www.great-web-sights.com, and do a
print preview. Note that the menu disappears in the preview. To read about
print media stylesheets, go here -
http://www.alistapart.com/articles/goingtoprint/

Finally, programmatic prints will fail on Mac/IE5x. You can get around that
like this -

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();
}

function writeOutPrintLink(){
document.getElementById('printLink').innerHTML = '<a
href="javascript:print_page();">Print this</a>'

}

</script>

Adjust the body tag of the document as follows -

<body ... onload="writeOutPrintLink();"> (where the ellipsis indicates
already existing attributes, if any)
<span id="printLink"></span>

That way, the link only shows up if you have javascript enabled.
 

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