This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Printing Pop up window

 
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
 
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
 
There's a way to do it better - find it. -Edison. A better tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic