473,657 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to print() one frame from another

Hello,

I have 2 frames. The top one is the control frame and the bottom one is
the display. I have a roll-over button in the top frame that I want to use
to do a print() for the bottom frame.
I tried having this JavaScript code when the roll-over button is clicked:
parent.frames[1].focus();parent .frames[1].print()

I am using Internet Explorer on Windows, and I am getting a print window
with "Only the selected frame" selected. But when I click the "OK" button
to tell Windows to print, it prints the top frame instead of the bottom
one...

I also tried putting this function in the header of the bottom frame, and
then calling it from the top frame:
function FramePrint()
{
self.print()
}

But it still likes to print the top frame...

Thanks,
Scott Navarre
Jul 20 '05 #1
4 6238
"Scott Navarre" <sm*@asus.net > wrote in message news:<bu******* **@enews4.newsg uy.com>...
I have 2 frames. The top one is the control frame and the bottom one is
the display. I'm doing a similar thing on a project i'm working on
I am using Internet Explorer on Windows, yep same here,
But it still likes to print the top frame...

Hmm, I get the same results, but I also tried on Mozilla,
Guess what, it worked like it should, bottom frame printed nicely.

The problem looks like another Microsoft 'feature'
(standards ? what stsndards?)

My resort - a bit messy, is to place a button on the page to be
printed and 'hide'it from the printer with css. If you detect a
compliant browser you can hide the button fully, or just don't being
display in the first place.

Have you made any progress ?

I'm going to try the Microsoft site.

Cheers

Ron.
Jul 20 '05 #2
: I tried having this JavaScript code when the roll-over button is
clicked:
: parent.frames[1].focus();parent .frames[1].print()

I have an iframe on my main page.
I use parent.window.p rint(); from the iframe.
That works in MSIE and NN/Moz.

: I am using Internet Explorer on Windows, and I am getting a print window
: with "Only the selected frame" selected. But when I click the "OK" button
: to tell Windows to print, it prints the top frame instead of the bottom
: one...

Maybe you want to open a new window with the frame and print that one?
Look at some lyric sites, they have print buttons for frame printing too.

Wouter
Jul 20 '05 #3
function PrintMain()
{

document.getEle mentById('conte nxtmenu').style .setAttribute(' display','none' )
;
if (document.all)
document.body.f ocus();
window.print();

document.getEle mentById('conte nxtmenu').style .setAttribute(' display','block '
);
}

Will print only the mainpage in my case.. when the childframe calls
parent.PrintMai n(); So the body is focused instead of the frame..

So frame[1].body.focus() might do the trick in your case?

Wouter
Jul 20 '05 #4
:
document.getEle mentById('conte nxtmenu').style .setAttribute(' display','none' )

replaced by
document.getEle mentById('conte nxtmenu').style .display='none' ;

NN/Moz gives it's OK too.
IE5+ needs a document.body.f ocus(); of the frame that needs to be printed.

Wouter
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9439
by: Marcus Bjorke | last post by:
I use a print link that causes a problem with Opera 7. The link looks like this <a href="javascript:parent.frames.mainFrame.print()">Print this page</a> I also used <a href="javascript:print()">Print this page</a> and it also worked with most browsers. I realize that it only works if you have Microsoft Windows versions for PC but that is what most of out customers have anyway. I have also noticed that there is a problem
2
7348
by: scrimp | last post by:
Well, Ive been searching through google groups and Ive seen a lot about printing a pdf file, but I havent seen a definite answer. I tried this code: f = open(printer_path, 'w') f.write(pdffile_path) f.close() Basically it doesnt work and what it prints out is the value of pdffile_path variable. If anyone can offer some help, Id appreaciate it
3
2075
by: dana lees | last post by:
Hi, I'm writing a C# asp.net web application. I have a frameset in which the upper frame contains a "print" button and the lower frame contains content of a different domain. Since i cannot call window.print() in another domain, i'm trying to trigger an event in my lower frame that will call window.print() itself... How can i do that?
8
3806
by: Veerle | last post by:
Suppose having a frameset consisting of two frames, both with dark background colors. One of the frames is a sort of menu and the other one contains the content. When someone clicks a menu item in the first frame, another page is loaded in the second frame. I know it is not a nice solution, but given this situation, is it possible to set the background color of the second frame, so that in between loading the pages with a dark background...
9
1447
by: jim-on-linux | last post by:
This is the situation I'm in. I've built a single file utility using py2exe. I zip the dist directory and send it to the client. For clients that use win95, win98 machines, They unpack the zip file and run the exe. The utility creates a text file that is sent to the printer with the statement below.
41
7604
by: Cartoper | last post by:
I hear it is possible to disable the web browsers print function, does anyone know how to do that?
2
1926
by: Carnell, James E | last post by:
I am thinking about purchasing a book, but wanted to make sure I could get through the code that implements what the book is about (Artificial Intelligence a Modern Approach). Anyway, I'm not a very good programmer and OOP is still sinking in, so please don't answer my questions like I really know anything. MY QUESTION: What is a slot? In class Object below the __init__ has a slot. Note: The slot makes use of a data object called...
1
1410
by: gayak | last post by:
Hi all, When I try to print a page. I am unable to do so. I get a javascript error as "Access is Denied". When I googled I found out that the script in one window or frame is trying to access another window or frame whose document's domain is different from the document containing the script. How to overcome this issue Please Advice. Many thanks in advance
3
30810
by: Tim | last post by:
Folks, I'm trying to format a print string so that it reports progress whilst processing a looping structure with a date time stamp appended to the end of the string. This started out life as a simple need to create a display that show progress to users when updating large tables in a data warehouse in real time. I have subsequently address that need through a different method, however I am challenged by the seeming impossibility to...
0
1674
by: helplakshmi | last post by:
I want to print a page from another page. I have a master page with links to other page. When I click "print," it should print the another page. The function window.print() is printing only the active page. So on click print i am opening a new window. In the onload event of the target page i have used <body onload="window.focus();window.print();window.close();"> Eventhough it's working, at the same time the window is also popping up...
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.