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

Redirect to a frame

Status
Not open for further replies.

lucidity23

Programmer
Feb 14, 2001
99
US
I am trying to figure out how to redirect to a certain frame...if not that...then to have the link open in the entire window...because I am already in frames so normally it would load in the frame it is in...or not?

Lastly...can u load to different URL's into 2 different frames from the same code?

THANKS!!!!
 
I'm not sure that I really understand what you mean. But I'll take a shot at it.

If you want to have one frame be redirected by what is done in another frame, then try this:
three frames: topFrame, leftFrame, & rightFrame...

In top_frame:
<input type=button value=Edit name=btnEdit>
<input type=button value=Delete name=btnDelete>

<script language=&quot;VBScript&quot;>
<!--
Sub btnEdit_OnClick()
parent.leftFrame.location.href = &quot;/EditLeftFrame.asp&quot;
parent.rightFrame.location.href = &quot;/EditRightFrame.asp&quot;
End Sub

Sub btnDelete_OnClick()
parent.leftFrame.location.href = &quot;/DeleteLeftFrame.asp&quot;
parent.rightFrame.location.href = &quot;/DeleteLeftFrame.asp&quot;
End Sub
-->
</Script>

--------------------------------

when you click on the Edit button, it will move the left frame to EditLeftFrame.asp, and the right frame to EditRightFrame.asp.
When you click on the Delete button, it will move the left frame to DeleteLeftFrame.asp, and the right frame to DeleteRightFrame.asp.

if you don't want a frame to be relocated, but instead get out of frames and have the whole window relocate:

parent.location.href.

Just cut out the frame name.

Hope this helps.
-Ovatvvon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top