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

Print button to print another frame

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi. I have a window with a top (menu) frame and a bottom (main) frame. I'm trying to have a print button at the menu frame that will print the main frame only. I tried parent.main.print, but it is still printing itself only, ie only the menu is being printed.
 
try parent.frames[indexOfthefrmayouwanttoprint].print(); adam@aauser.com
 
Thanks!

It didn't work either. I wonder whether it's because I have multiple frameset.

This is my frame code

<frameset ROWS=&quot;12%,*&quot;>
<frameset cols=&quot;30%,*&quot;>
<frame SRC=&quot;logo.htm&quot; NAME=&quot;top1&quot;>
<frame SRC=&quot;menu.asp&quot; NAME=&quot;top2&quot;>
</frameset>
<frame SRC=&quot;frmlogin.htm&quot; NAME=&quot;main&quot;>
</frameset>

At menu.asp, I have a javascript print function and I have also tried a parent.parent. It's still printing itself only:

<SCRIPT LANGUAGE=javascript>
<!--
function printNow() {
parent.frames[2].print();
//parent.parent.frames[2].print();

}
//-->
</SCRIPT>

Any ideas? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top