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

Printing Selected Frame

Status
Not open for further replies.

Dabase

Programmer
Apr 2, 2004
122
PT
Hi,

I am trying to add a Print button to my HTML page (which consists of 3 frames) but I am not having any luck with this.

The reason why I need this print button on the page is because if I try to print from File | Print in IE, it prints the entire page as seen on screen, but I only what to print a specific frame.

Any help with this will be much appreciated.

Thanks
Dabase
 

To print only the selected frame, rather than using "Print", use "Print Preview", and change the option that says "As laid out on screen" to become "Only the selected frame".

Using Javascript, you can target the frame you want to print thus:

Code:
framename.print();

Hope this helps,
Dan


 

Oh yes - when I say "framename", you may need to use the full path to the desired frame from whatever frame you are in, rather than just the frame name - but you can try both and see whichever works.

Dan


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top