Solved

Handle print  dialog box

Posted on 2001-06-14
4
396 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

710 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