Solved

window.open remove minimize and maximize buttons from popup

Posted on 2004-05-01
10
28,222 Views
Last Modified: 2012-08-14
I know this question has been answered, but I can't view the solution since I terminated my subscription to premium services.

I searched in the JavaScript Area for "minimize remove" - the second question seems to have the answer.  This should be an easy 125 points.

Here's my current code in case it's helps anyone.  The third argument to OpenDialog is passed directly to window.open "as is".

function MBPopup_Hack(url,dialog,height,width)
{
  MetaBuilders_DialogWindow_OpenDialog(url, dialog, 'resizable=no,menubar=no,status=no,toolbar=no,scrollbars=no,location=0, directories=0,dependant=yes,dialog=yes,modal=yes,unadorned=yes,height=' + height + ',width=' + width + ',left=100,top=100');
  return false;
}

0
Comment
Question by:todd_pravata
  • 5
  • 3
  • 2
10 Comments
 
LVL 12

Expert Comment

by:lil_puffball
ID: 10969738
The answer to that question is this:

<html>
<head>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function window_onload() {
     var hWnd = window.showModalDialog("http://aav1.aavacations.com/Consumer/aavspcfc.asp?BROCHURE=B2","HelpWindow","width=600,height=400,location=no,status=no,
menubar=no,toolbar=no,resizable=no,scrollbars=no");
     
}

//-->
</SCRIPT>
</head>
<body  LANGUAGE=javascript onload="return window_onload()">
<form name="form1" method="post"  action="test.asp">
<input type="text" name="name1" value="">
<input type="submit" name="asad" value="edit">
</form>
</body>
</html>
0
 

Author Comment

by:todd_pravata
ID: 10970010
Sorry, I had no success with showModalDialog.  Also, it appears that it is IE specific.

Isn't there just some way to tell window.open to not show the minimize and maximize buttons?
0
 
LVL 10

Assisted Solution

by:eeBlueShadow
eeBlueShadow earned 60 total points
ID: 10971289
>> Isn't there just some way to tell window.open to not show the minimize and maximize buttons?

no. (sorry)
0
 
LVL 12

Accepted Solution

by:
lil_puffball earned 65 total points
ID: 10972020
No, as eeBlueShadow mentioned it cannot be done easily.

IE only again, with no control over the size:

window.open("url.htm","","fullscreen=yes")
0
 

Author Comment

by:todd_pravata
ID: 10972586
Seems like I will need to award points for a No answer :( - of which there were two.  

Maybe this can break the tie:

Here are the attributes I'm using (see below).  The minimize button comes up enabled (not desired), the maximize shows as disabled (desired).  When I click on the minimize button, nothing happens - which is OK.

I don't want the user to minimize, maximize (or resize) the window ... and they can't as it stands now, but I'd prefer if the minimize button was also disabled.  Is there anyway to accomplish this?

I've searched high and low for this so I really appreciate the help.  Thanks.

window.open("foo.htm", "", "modal=1, height=200, width=200");

FYI - I removed all the of the other attributes that were mentioned in the original question as they seemed to have no effect.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

by:lil_puffball
ID: 10972781
Here's a pretty good workaround:

<script>
var timeint,win;
function showWin(url,w,h){
  if(window.showModalDialog){
    window.showModalDialog(url,null,"dialogWidth="+w+"px;dialogHeight="+h+"px");
  }else{
    win=window.open(url,"","width="+w+",height="+h+",resizable=no");
    document.onfocus=function(){win.focus();}
    timeint=setInterval("if(win.closed){clearInterval(timeint);document.onfocus=null;}else{win.focus();}",100);
  }
}
</script>

<button onclick="showWin('test.htm',200,200);">Show Window</button>
0
 
LVL 12

Expert Comment

by:lil_puffball
ID: 10972789
Reread your post, you mention that "When I click on the minimize button, nothing happens - which is OK." How have you accomplished this?
0
 
LVL 10

Expert Comment

by:eeBlueShadow
ID: 10973343
Don't worry about the deadlock, there's not many people as fast as lil_puffball ;)

Maybe I'll get to a question before her one day :P

_Blue
0
 

Author Comment

by:todd_pravata
ID: 10973391
Not sure.

I had this

window.open("foo.htm", "", "modal=1, height=200, width=200");

and just changed it to this

window.open("foo.htm", "", "height=200, width=200");

Still looks the same and does the same thing.  So I have no idea why minimize does nothing when clicked.

I'm in an IE 6.0 browser and I don't want to write anything browser specific.  If there is no way to do this, then I'll just live with that.  Not sure what your code does.

FYI - any boolean type window.open attribute that you do not set defaults to false|no|0.  So, saying resizable=no, is just the same as not saying it at all.
0
 
LVL 12

Expert Comment

by:lil_puffball
ID: 10973417
Blue, lol...I just have lots of time on my hands. ;)

todd,
with your code minimize does work when you click it, seems weird that it doesn't...
My code is not browser specific. It works nicer with IE, but if the browser does not support showModalDialog, it generates a work around that's not so nice but works. Have you tried it out?
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now