Click to See Complete Forum and Search --> : remote window with Jump Menu


vakm
11-17-2004, 11:46 AM
Hey,
I have a Jump Menu that currently works when I link it to an HTML page within the same frame or if I use JavaScript to open a new window with the URL designated in the JavaScript. The problem I'm having now, is I want to use the same JavaScript to open multiple remote windows from the Jump Menu. When I use the remote code and designate the URL within the dropdown, the dropdown does not work. But if I use it as a text link elsewhere it does. How do I write it so both functions work within the same dropdown?

Thanks in advance!

Here is what I currently have:

<SCRIPT LANGUAGE="JavaScript">
<!--

function launch(url) {
self.name = "opener";
remote = MM_popupMsg('message to users.');open(url, "fincon", "resizable,status,width=460,height=425");
}

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

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function MM_popupMsg(msg) { //v1.0
alert(msg);
}
// -->
</SCRIPT>
<body>
<select name="invest" class="menu" onChange="MM_jumpMenu('parent.frames[\'mainFrame\']',this,1)">
<option selected value="">Name</option>
<option value=""></option>
<option value="javascript:launch('http://www.url.com')">Option 1</option>
<option value="page.html">Option 2</option>
<option value="page.html">Option 3</option>
</select>
</body>

Mr J
11-17-2004, 03:38 PM
Do you mean something like this

<SCRIPT LANGUAGE="JavaScript">
<!--

function open_window(url){
newWin = open(url,'','width=200,height=100,top=300,left=250' )
}


// -->
</SCRIPT>

<a href="#null" onclick="open_window('page.html')">CLICK</a><BR>

<select name="invest" class="menu" onChange="open_window(this.options[selectedIndex].value)">
<option selected value="">Name</option>
<option value=""></option>
<option value="page1.html">Option 1</option>
<option value="page2.html">Option 2</option>
<option value="page3.html">Option 3</option>
</select>

vakm
11-17-2004, 03:50 PM
Yes! Thank you, only within that same drop down that is opening a new window, I need some of the other options in that drop down to link to a page that needs to open in the same frame as the drop down is contained in.

Thanks so much for helping

Mr J
11-18-2004, 01:50 PM
I am not exactly sure which would be the best method to use here but here is one way.

Any page that you want to be opened in a new window must begin with an asterisk

*




<SCRIPT LANGUAGE="JavaScript">
<!--
function open_window(url){
if(url.indexOf("*")== -1){
location=url
}
else{
url=url.substring(1,url.length)
newWin=open(url,'','width=200,height=100,top=300,left=250')
}

}
// -->
</SCRIPT>

<select name="invest" class="menu" onChange="open_window(this.options[selectedIndex].value)">
<option selected value="">Name</option>
<option value=""></option>
<option value="page1.html">Option 1</option>
<option value="page2.html">Option 2</option>
<option value="*page3.html">Option 3</option>
</select>




The embolded line is all one line, for some reason this forum is not rendering that line correctly

vakm
11-18-2004, 02:24 PM
Thank you! That's perfect and easy for me to understand and learn.

Thank you so much!