472,958 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Problem with window.print

I am having a problem with window.print in a popup window.

I am creating 2 popup windows both with a print button in them, 1
works the other doesn't. Code runs in a javascript function on a
webpage. Here is the difference :

First example (works) -

mywinman=window.open('t&cs.htm','win2','toolbar=no ,location=no,directories=no,status=no,menubar=no,s crollbars=yes,resizable=no,width=600,height=500,le ft=100,top=100');

htm file contains this button -
<INPUT type='button' value='Print' OnClick='window.print()'>

Second example (no errors but nothing happens) -

mywin=window.open('','win1','toolbar=no,location=n o,directories=no,status=no,menubar=no,scrollbars=y es,resizable=no,width=550,height=600,left=50,top=5 0');

content created using document write in a loop as follows :

mywin.document.write(html_line [i]);

code is in the line eg.
html_line [idx] = "<INPUT type='button' value='Print'
OnClick='window.print()'>";

It seems that somehow I am not specifying the window correctly
although I have tried various combinations.

I am sure it is something stupid as usual. Thanks in advance.

John

Jul 20 '05 #1
1 7797
On Thu, 14 Aug 2003 21:41:26 +0000 (UTC), John <j@laycus.con> wrote:
I am having a problem with window.print in a popup window.

I am creating 2 popup windows both with a print button in them, 1
works the other doesn't. Code runs in a javascript function on a
webpage. Here is the difference :

First example (works) -

mywinman=window.open('t&cs.htm','win2','toolbar=n o,location=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=no,width=600,height=500,l eft=100,top=100');

htm file contains this button -
<INPUT type='button' value='Print' OnClick='window.print()'>

Second example (no errors but nothing happens) -

mywin=window.open('','win1','toolbar=no,location= no,directories=no,status=no,menubar=no,scrollbars= yes,resizable=no,width=550,height=600,left=50,top= 50');

content created using document write in a loop as follows :

mywin.document.write(html_line [i]);

code is in the line eg.
html_line [idx] = "<INPUT type='button' value='Print'
OnClick='window.print()'>";

It seems that somehow I am not specifying the window correctly
although I have tried various combinations.

I am sure it is something stupid as usual. Thanks in advance.

John


BTW Just noticed it works fine with Netscape 7 but not IE6

Jul 20 '05 #2

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

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
3
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...
0
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust...
1
by: dibyendu_k | last post by:
Hi, There is a problem i cant solve regarding Internet Explorer 5.5. It is regarding the Print Dialog Box. From a webpage if I open a popup window (window.open()) containing buttons Print and...
0
by: Stewart Midwinter | last post by:
I have a Tkinter app running on cygwin. It includes a Test menu item that does nothing more than fetch a directory listing and display it in a Toplevel window (I'd use a tkMessageBox showinfo...
8
by: makunag | last post by:
Didn't get answer with google and in my regular forum. Came across this site and posting here. Your help will be highly appreciated ! Our application have frames - MainNav, TaskNave and Content....
2
by: =?Utf-8?B?aGVsZmk=?= | last post by:
Hi all, I have replied with my own questions to an older post entry but after a while I thought it's better to start a new thread based on the previous one. Perhaps with the new thread I will...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.