Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing Pop up window

 
James Kerruish
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having problems printing the contents of a new window that I create under Netscape. When using IE everything seems to work fine. Under netscape when I try to print the contents of the new window it prints the contents of the original window that created the new window.
So from the main window I code:
DispWin = window.open('','NewWin','directories,location,toolbar,status,menubar,resizable,scrollbars =yes,width=600,height=600');
to open the new window and then I add text to it for example:
DispWin.document.write("<table cellpadding='5'> <tr> <td>");
etc
Then I need to be able to print this DispWin but like I say Netscape prints the original window instead of DispWin when print is pressed on the toolbar of the DispWin window.
Thanks
 
A1ien51 CNEUFOs
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where asre you trying to print this window from? The parent or the child(aka popup)??
 
James Kerruish
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens is that a user enter some details about themselves in a form and when they press a button this opens a new window called DispWin which displays all the data the user has entered. This works fine but when I try to print the contents of the new window (by pressing print on the toolbar of the DispWin) it prints the orignal window with the form in it and not the contents of DispWin like I say this only seems to happen under Netscape.
Thanks
 
A1ien51 CNEUFOs
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got to love netscape...hehhee
okay lets see here, now are you writing this new pop up dynamically??
also here are some other things you can do and see if this works
print it from the other window
<input type="button" value="Print PopUp" onclick="DispWin.focus();DispWin.print()" name="PopPrinter">
you can also put the button on the popup
<input type="button" value="Print PopUp" onclick="window.print()" name="PopPrinter">
See if that works, if not, give me a link or something, and i might be able to figure it out

 
James Kerruish
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly thanks for your help although I seem no closer to an answer. I've tried the two suggestions you gave but no luck. I've put the page on a website although the page is all a bit rough at the moment and the code isn't very easy to follow. The key area you need to look at in the code is the function Display() this is the function that is activated when the user presses the display button after filling in the form and it writes the data to a new window.
Note that I having problems with netscape and I'm using version 4.7(I think), it works ok with version 6 and explorer(to my knowledge).
ok well the link is http://www.kerruish.co.uk/PopUp/entryform3.htm
like I say it's not that easy to follow so please ask any questions if you don't follow anything.
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic