Solved

ShowModalDialog

Posted on 2004-08-27
9
514 Views
Last Modified: 2012-05-05
Hi experts.I have an asp page that uses vbscript from the client so that it displays a Modal Dialog window(another page that is) with the showModalDialog function.All i want is to get rid off that annoying toolbal on the top of the window(the one with the x that closes the window).Is this doable?
If not that way i would like to give me some alternatives although i would like to do it wioth the showModalDialog function cause my whole site is based on it.

Thank all in advance
0
Comment
Question by:adktd
[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
  • 3
  • 2
  • +1
9 Comments
 
LVL 3

Expert Comment

by:Squew01
ID: 11912656
It's not possible but you can use layer instead...

Else use this code

var d=showModalDialog('mypage.asp',window,'status:no;resizable:no;scroll:off;');
0
 
LVL 1

Author Comment

by:adktd
ID: 11913000
thanks that's exactly the way i have it right now,but that doesn't desappear the toolbar from the window. After surfing the web i came across quit a few nonclosable popups. Can't this be used on a modaldialog too?
0
 
LVL 3

Expert Comment

by:Squew01
ID: 11914781
Instead of using ShowModalDialog, you can use DIV (layer) which won't be closable.

Example here: http://www.siteexperts.com/tips/elements/ts24/DialogBox.htm

/squew/

0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 1

Expert Comment

by:r3gan
ID: 11918103
Regarding Squew01's comment, the link posted (although does solve the problem of the upper right 'X' in the titlebar) sacrifices the 'modal' functionallity of the popup as well as the ability to drag/move the popup.  If you would like to use the showModalDialog feature, it is probably best to simply code your pages so that they will respond to a modal window that has been closed with the 'X'... I believe the return value from this window will be 'null' or 'undefined' for this situation.

Regards,
-Regan
0
 
LVL 3

Expert Comment

by:Squew01
ID: 11921533
You can have fulscreen popup, which disable the user to interact with anything else on the page...

For this, create a layer that cover the whole screen...

/squew/
0
 
LVL 1

Author Comment

by:adktd
ID: 11928978
I know that the x that close sthe modaldialog window returns "" value,that's why i have already a button that does that ,and that's why i don't want the x button. I can't use a fulscreen popup cause i want the user not to be able to do anything else.
0
 
LVL 1

Expert Comment

by:r3gan
ID: 11931232
I don't think you can disabled the 'X' button on a showModalDialog() window.  I have seen the use of 'chromeless windows', but be cautioned!  This script does not work on machines with WinXP SP1....

http://www.dynamicdrive.com/dynamicindex8/chromeless.htm
0
 
LVL 2

Accepted Solution

by:
Epistemo earned 85 total points
ID: 11931478
In the new versions of IE the Chromeless window feature has been removed. (People were mis-using the capability by layering boxes on top of email validators @ ebay and such.)
Then the showModalDialog() has to have the X to close the window , there is no way around this.
Why do you wnat a dialog anyways? For loading bar or something? Because the dialog box can't really communicate with other windows at all.
I would just use a popup ... but if you use the dialog just for sake of protecting the content then you could always do the following script inside this popup window.

<script type="text/javascript">
if(navigator.appName!="Microsoft Internet Explorer"){
document.addEventListener("keydown",ctrlIntercept,false);
}else{
document.attachEvent("onkeydown",ctrlIntercept);
}

function ctrlIntercept(e){
if(typeof event!='undefined'){
var pressedKey=window.event.keyCode
}else{
var pressedKey=e.keyCode
}
if (pressedKey==17)window.close();
}
IE4plus = (document.all) ? true : false;
NS4 = (document.layers) ? true : false;

function clickIE()
{ return false; }
function clickNS(e)
{
if (e.which==2 || e.which==3)
{ return false; }
}
if (!IE4plus)
{
document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
document.onmousedown=clickNS;
document.onmouseup= clickNS;
document.oncontextmenu=clickIE;
}
else
{
document.onmouseup= clickIE;
document.oncontextmenu=clickIE;
}
</script>
<body onBlur="window.close();">

This will not allow right click and even close the window if the person tries to do a ctrl-N.

Content will still go into the temp files and such, yet ... just an idea.


0
 
LVL 1

Author Comment

by:adktd
ID: 11939199
thank u so much that was exactly what i needed.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

707 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