Solved

window.open remove minimize and maximize buttons from popup

Posted on 2004-05-01
10
29,248 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 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
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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

726 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