Connecting Tech Pros Worldwide Forums | Help | Site Map

trying to print a page in a different frame

David Cho
Guest
 
Posts: n/a
#1: Jul 20 '05
My button to print a document is in one frame, but the target doc is in a
different one.

The button
=======
<input type="submit" name="btnPrint" value="Print Application" id="btnPrint"
class="Buttons" onClick="javascript:top.main.window.print();return false;"
/>

The frame page
===========
<frame name="header" src="submit_page.aspx" scrolling="no" noresize>
<frame name="main" src="application_xslt.aspx">

It does print, but not the page I want. It keeps printing the page where
the button is located. Thanks for your help in advance. I am trying to
print the "main" frame. Does it have anything to do with the fact that it
is an ASP.NET page?



DJ WIce
Guest
 
Posts: n/a
#2: Jul 20 '05

re: trying to print a page in a different frame


in the main pages:


function PrintMain()
{
if (document.all)
document.body.focus(); //MSIE needs focus the the right frame first
window.print();
}


then call that from the other frame.
Wouter

"David Cho" <spammersgohome@spammersgohome.com> wrote in message
news:5RITb.3449$a65.3202@twister.socal.rr.com...
: My button to print a document is in one frame, but the target doc is in a
: different one.
:
: The button
: =======
: <input type="submit" name="btnPrint" value="Print Application"
id="btnPrint"
: class="Buttons" onClick="javascript:top.main.window.print();return false;"
: />
:
: The frame page
: ===========
: <frame name="header" src="submit_page.aspx" scrolling="no" noresize>
: <frame name="main" src="application_xslt.aspx">
:
: It does print, but not the page I want. It keeps printing the page where
: the button is located. Thanks for your help in advance. I am trying to
: print the "main" frame. Does it have anything to do with the fact that it
: is an ASP.NET page?
:
:


David
Guest
 
Posts: n/a
#3: Jul 20 '05

re: trying to print a page in a different frame


[color=blue]
>
> function PrintMain()
> {
> if (document.all)
> document.body.focus(); //MSIE needs focus the the right frame first
> window.print();
> }
>
>
> then call that from the other frame.
> Wouter[/color]

Thank you for your response, but exactly how do I do that? (I am a
javascript novice). Again, the frame where the button is called "header"
and the page I am trying to print is "main"


Closed Thread


Similar JavaScript / Ajax / DHTML bytes