geke hand
A N S W E R S
Question: How to print an HTML or ASP page through a printer. Suppose a page has 3 frames and I just want to print one of them.then how it could be done.Please Help...

(asked by Pankaj)

Answer:

(answered by phalen on 3/1/2004)

You can print the contents of a single frame by calling the print() method for that window object from within any of the three frames on your page.

Assuming that the top frame was "headerframe", middle frame "bodyframe" and a bottom frame "footerframe" and that you wanted to print "bodyframe" from "headerframe", place this code in the HEAD section of the page which is displayed in "headerframe":

<script type="text/javascript">
function printframe (sFrame) {
this.parent.frames(sFrame).print();
}
</script>

Then call that function from a link such as this:

<a href="javascript:printframe('bodyframe');">Print</a>

A N S W E R S

design by G E K E . N E T
best viewed in 1024x768 screen resolution using a standards compliant browser
logo based on a public domain drawing of a hand making the sign of the cross, no disrespect is intended
all other contents and code copyright © 2002-2005 jonathan cook

Valid HTML 4.01! Valid CSS!