Solved

window.open remove minimize and maximize buttons from popup

Posted on 2004-05-01
10
28,628 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…
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…

770 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