Click to See Complete Forum and Search --> : [RESOLVED] Help needed with menu in frame


acorna
07-30-2008, 08:47 AM
Hi all

Sorry to be so thick but I can't find the answer anywhere.

I am using a drop down menu in a frame (Main) and I need the selection to open in the same frame. This is what I am using. I know it's something to do with the windows.open command but I don't know what to replace it with.

Thanks in advance.

Ray

<script language="JavaScript">

// Benny Sparano benny3@chelsea.ios.com
// feel free to use this script as long as this text remains intact
// please link JavaScript World- Your Site for any and all JavaScript Info!
// http://chelsea.ios.com/~benny3/javascript/
// Copyright 1997 JavaScript World

<!-- Hide the script from old browsers --

function surfto(form) {

var myindex=form.dest.selectedIndex

window.open(form.dest.options[myindex].value,"main","");

}

//-->

</SCRIPT>

<FORM NAME="myform">

<div align="right">
<SELECT NAME="dest" SIZE=1>

<OPTION VALUE="">---------- Select Results
<OPTION VALUE="d1mf.php">Day 1 Morning Fourball
<OPTION VALUE="d1af.php">Day 1 Afternoon Fourball
<OPTION VALUE="d2mf.php">Day 2 Morning Fourball
<OPTION VALUE="d2af.php">Day 2 Afternoon Fourball
<OPTION VALUE="d3s.php">Day 3 Singles
</SELECT>

<INPUT TYPE="BUTTON" VALUE="Go" onClick="surfto(this.form)">
</div>
</FORM></CENTER>

cgishack
07-30-2008, 11:43 AM
If you want the selection to open in the SAME frame you need to set the documents location to the URL and not window.open().



function surfto(form) {

var myindex=form.dest.selectedIndex

document.location.href = form.dest.options[myindex].value;

}

acorna
07-30-2008, 12:29 PM
Thank you very much, thats exactly what I needed.

Ray