Solved

BROWSER PRINT

Posted on 2000-02-18
4
240 Views
Last Modified: 2010-04-09
I need to know how to enable a visitor to a page on my site, to print off the particular frame that the print button is in..  is this possible?  I.e. they have visted a page, it has some information in a particular frame that will be designed as "printer friendly", and they can just press a button and it prints that page off...
thanks...
0
Comment
Question by:euphoni
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 2534845
Generally speaking, in the frame that is to be printed, do this:

<FORM>
<INPUT type='button' name='cmdPrint' value='Print' onClick='self.print();'>
</form>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2534860
The above should work as is in Netscape and IE5.
For IE4, you will have to include the print.js file.  See this site:
  http://msdn.microsoft.com/workshop/Author/script/DHTMLPRINT.asp 

and download this file:

  http://msdn.microsoft.com/workshop/Author/script/print.js 

Once you include print.js, a print button can be done for both NS and IE like this:

  <INPUT type='button' name='cmdPrint' value='Print' onClick='self.print()'>

For more examples see:
  http://msdn.microsoft.com/workshop/Author/script/samp1.htm 
  http://msdn.microsoft.com/workshop/Author/script/samp2.htm 
  http://msdn.microsoft.com/workshop/Author/script/samp3.htm 
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 2534877
(locking)

Also, if you want to put the print button in a different frame than the one to be printed, do this:

<FORM>
<INPUT type='button' name='cmdPrint' value='Print' onClick='top.NameOfTheFrameToBePrinted.print();'>
</form>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2542577
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question