Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

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>

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() {

Submitted by S├ębastien Anselment

©2018 Martin Webb