Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Print | Q1525 [ previous next ]

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

©2018 Martin Webb