Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1525 How to print a certain frame in a frameset from another frame in the same frameset

irt.org | Knowledge Base | JavaScript | Print | Q1525 [ previous next ]

Q1525 How to print a certain frame in a frameset from another frame in the same frameset

First set the focus to the frame you wish to print, and in the same commandline give the window.print() command:

<frameset rows="30%,*">
<frame name="controll" scr="control.htm>
<frame name="mainpage" scr="main.htm>
</frameset>

In the control.htm:

<form><input type="button" value="Print" onClick="parent.mainpage.focus();window.print()"></form>

Submitted by Gerrit Krijgsman

To print Frame B from Frame A, try:

<a href="javascript:printit()">Print</a>

Add the following code somewhere in your source of Frame A:

<script language="JavaScript"><!--
function printit() {
  parent.frameB.focus();
  parent.frameB.print();
}
//--></script>

Submitted by Sébastien Anselment


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.