I have two frames: one i want to display and a hidden one I want to print when a print button is clicked in the displayed frame. Here's the frame code: <frameset rows="100%,*"> <frame src="disclosure1.htm" name="frameA"> <frame src="disclosure2.htm" Name="frameB"> </frameset> and here's the button code in frameA: <input type="button" class="button" value="Print This Page" onclick="parent.frameB.focus();window.print()"> This works fine in IE and prints frameB, but with Mozilla it just prints frameA. Could some knowledgeable person please tell me what I need to do to make make it work with Mozilla? It would be appreaciated. Regards, Page Hite
Put the function to print the window in the head of that document. <html> <head> <script type="text/javascript"> function printThis(){ self.print(); } </script> </head> Code (markup): Then call that function from the other document. <input type="button" class="button" value="Print This Page" onclick="parent.frames['frameB'].printThis()"> Code (markup):
Thanks for the prompt reply. By "that document", did you mean disclosure2.htm, the document I want to print? I did this and in IE the print button now prints frameA instead of frameB. Did I do it correctly and should it work for both IEand Mozilla? Regards, Page Hite
self.print() Code (markup): speaks for itself, don't you think? Why wouldn't you just move it to the other document and test it? The code is cross-browser.
Thanks for your help. Understand the issue now. I'm using this in the first frame with no script in the second. onclick="parent.frames['frameB'].focus(); parent.frames['frameB'].print()" Appears to be cross-browser. Appreciate your assistance. Regards, Page Hite