Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make a jump menu pop up a new window? 1

Status
Not open for further replies.

farnorth

Technical User
Aug 14, 2002
32
US
I need to make this jump menu do a pop up window. I can't get the code right. Below is the dreamwaever code for the jump, now how do I get it to pop a seperate window.

<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">

Help is very appreciated.

Thanks
Bob
 
Unfortunately blank gives an error you need to use
Code:
<select name="menu1" onChange="MM_jumpMenu('window.open()',this,0)">

[Peace][Pipe]
 
Cheech, That was too easy for you... LOL How about this one. If I wanted the window that poped up to be set to a certain size, no scroll etc how would I code that? Is it in the function of the form. I can't seem to incorporate it into the code below without making a mess all over the place.
Here is my code now. Thanks!!

<script language="JavaScript" type="text/JavaScript">
<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>
<form name="form1">
Model Specifications:
<select name="menu1" onChange="MM_jumpMenu('window.open()',this,0)">
<option selected>Select Model </option>
<option value="/inventory/specpages/AE7X12DS2.htm">12ft AE7X12DS2 </option>
<option value="/inventory/specpages/AE7X12DT2.htm">12ft AE7X12DT2 </option>
<option value="/inventory/specpages/AE7X16DT2.htm">16ft AE7X16DT2 </option>

</select>
</form>
 
If you need to set the size and position then we need to step away from MM's code, replace the MM_jumpMenu script with this
Code:
function openWin()  {
var url = document.forms.form1.menu1.value
  var width = 400                        //Set width
  var height = 300                        //Set Height
  var name = "winname"             //Set window name
  var top = 20                            //Set distance from top
  var left = 20                            //Set distance from bottom
  newwin=window.open(url, name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
}
You can now set the attributes as required, eg. width height top left toolbars etc. and then change the call in your menu to
Code:
onChange="openWin()"

All should now be as required

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top