Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

BROWSER PRINT

Posted on 2000-02-18
4
Medium Priority
?
245 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 1500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

636 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