Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

window.open remove minimize and maximize buttons from popup

Posted on 2004-05-01
10
Medium Priority
?
29,910 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
[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
  • 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 240 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Accepted Solution

by:
lil_puffball earned 260 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…

618 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