Solved

Handle print  dialog box

Posted on 2001-06-14
4
395 Views
Last Modified: 2012-05-05
Hi,

Is it possible to make print dialog box modal? Without clicking on OK or Cancel, User should not be allowed to navigate further.

Thanks in advance.

0
Comment
Question by:surkh
[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
  • 3
4 Comments
 
LVL 4

Expert Comment

by:jcs_clement
ID: 6194406
Is is what u are looking for ?

<html>
<script>
function callfun(){
    x = confirm("Do u want to continue ?")
    if(x){
          alert(" do something " )
       }
    else{
          alert( "do something else " )
      }
}
</script>
<body>
<input type="button" value="click" OnClick="callfun()">
</body>
</html>

rgds
jcs
0
 
LVL 4

Expert Comment

by:jcs_clement
ID: 6194413
Or is it something to do with the print dialog box
This one can do it is IE 4.0

<html>
<head>
<SCRIPT Language="Javascript">
function printit(){
   var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
   document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
   WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    
  // WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
This is a print test.
<form>
<input type=button value="Print this Page" name="Print" onClick="printit()">
</form>
</body>
</html>
0
 
LVL 4

Expert Comment

by:jcs_clement
ID: 6194414
Or is it something to do with the print dialog box
This one can do it is IE 4.0

<html>
<head>
<SCRIPT Language="Javascript">
function printit(){
   var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
   document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
   WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    
  // WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
This is a print test.
<form>
<input type=button value="Print this Page" name="Print" onClick="printit()">
</form>
</body>
</html>
0
 
LVL 1

Accepted Solution

by:
damianosky earned 50 total points
ID: 6194422
For what I know, there is no way to change the state of the dialogs in MSIE and/or Netscape.

In any case, remember that the behaviour is different according to browser version and type, so a solution which works on MSIE 5.x may not be right for 4.x or Netscape equivalent. Nescape 6.0 is an clear example: what goes on Netscape 4.x is not alway supported on Netscape 6...

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
email validation 9 47
href return to normal window 5 28
Table header must be on top 2 25
Javascript: Mouseup doesn't follow mousedown 13 23
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

740 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