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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frame Targets

Status
Not open for further replies.

pbcharlie

Technical User
Jan 16, 2002
55
0
0
I have a bit code that I am using to drive page changes, however I need to know if I can target it to a specific frame?

<script language=&quot;javascript&quot;>
//<!--
function changePage()
{
i = document.selectmenu.go.selectedindex;
window.location.href = document.selectmenu.go.value;
}

//-->
</script>
as this script currently opens a new page within the current frame.


The form that calls this function uses
<option value&quot;<%= Objeitem.name %>&quot;><%=Left(objitem.name., InstrRev(objItem.Name, &quot;.&quot;) -1)%></option>
 
Sure you can, just put the name of the target frame after the window object:

window.framexxx.document.location=document.selectmenu.go.value;

Sergio.

 
:( I have tried this now, and I still get an error.
<script language=&quot;javascript&quot;>
//<!--
function changePage()
{
i = document.selectmenu.go.selectedindex;
window.mainFrame.document.location = document.selectmenu.go.value;
}

//-->
</script>

Am I doing something wrong.
The Drop down is in the Top Frame and is trying to open a page in the mainFrame.
....


What Else can I do?

 
I am used to do this:

top.myframe.location.href=newLocation

That usually works fine.
 
The error can be the syntax of your script:

//<!--
function changePage()
{
i = document.selectmenu.go.selectedindex;
window.mainFrame.document.location = document.selectmenu.go.value;
}

//-->

Repair this:

1-(selectedIndex)

*** i=document.selectmenu.go.selectedIndex;


2-(options[])

*** window.mainFrame.document.location = document.selectmenu.go.options.value;

Sergio M. Netto.
 
The options, again:

*** window.mainFrame.document.location=
document.selectmenu.go.options.value;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top