[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ShowModalDialog

Posted on 2004-08-27
9
Medium Priority
?
517 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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 340 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

834 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