Solved

onafterprint firing when you open the print dialog box or the print preview dialog.  is it supposed to do this?

Posted on 2004-08-24
8
428 Views
Last Modified: 2008-02-01
this is probably more an asking for information question than a code question.  We're making an insurance agency application that works on the web and if they print a letter off my web word processor to send to a client i want it to automatically save a copy of the letter on the server for errors and ommissions purposes.  Anyways everything works, but i'm using the onafterprint event to trigger the save and its firing when you open the print dialog.  You don't even have to print. Just open the dialog.  Is this a bug??   Is there another way to do this if I can't get this to work.  
0
Comment
Question by:das165227
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 11884710
Hi

So this is basically intranet?

Regards,
Zyloch
0
 

Author Comment

by:das165227
ID: 11885115
its on the internet but only certain people will be allowed in and you can force them to use a certain browser etc...
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 11885156
Because the only other way I see it is to use ScriptX ActiveX control to stop the Print Dialog. This could make a lot of people mad, though, so think about it and post if you still want the solution.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:das165227
ID: 11887122
i don't if thats really my question.  don't it seem like a bug that the onafterprint event is firing when you just open the dialog.  i'm trying to judge if i should open a case with microsoft if its their bug or if i'm just being dumb.  
0
 

Author Comment

by:das165227
ID: 11887126
i don't know i mean
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
ID: 11887391
I wish it was a bug so we can get on Microsoft's case, but unfortunately,
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onafterprint.asp
makes it clear that onafterprint is doing its job. It fires immediately after the document prints OR previews for printing, which includes the print dialog.
0
 

Author Comment

by:das165227
ID: 11892159
thanks anyways
0
 

Author Comment

by:das165227
ID: 11905039
hey zyloch.  i just read this when i was looking for something else.  i don't want to take the points back from you or anything.  But according to this it seems like its a bug.  

Calling the print method has the same effect as choosing Print from the Microsoft Internet Explorer File menu. The print method activates the Print dialog box, prompting the user to change print settings. When the user clicks the OK button, the following sequence of events occurs:

The onbeforeprint event fires.
The document prints.
The onafterprint event fires.

The onbeforeprint and onafterprint events are particularly useful when not all the information on the page is visible at all times. Use the onbeforeprint to modify the document to make all the information on the page visible for printing. To return the document to its original state, use the onafterprint event.

this can be found at.....

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/print.asp
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress and Wufoo 1 40
How to check or uncheck a checkbox using the id of the checkbox 2 23
Read text on Table 7 30
15 puzzle in Javascript/html 2 44
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question