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

I'm at the end of my virtual rope! Help! - Parent/Child Problem 1

Status
Not open for further replies.

frenchtaquito

Technical User
Apr 5, 2001
56
0
0
US
Hi y'all! I am a js newbie but I am building a site in Dreamweaver. I have tried everything I could possibly come up with to get this script to work. I want the url entered by the user to open in the parent frame rather than the frame the script is in. I tried window.opener but it doesn't seem to work. Here is the script opening the url in the child frame. Any ideas?



<form>
<div align=&quot;center&quot;>
<input name=&quot;url&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;25&quot; onAfterUpdate=&quot;window.location=this.form.url.value&quot;>
<input type=&quot;button&quot; value=&quot;Click Here&quot; onClick=&quot;window.location=this.form.url.value&quot;>
</div>
</form>

Thanks!
 
You have to reference the frame that you want the new page to load in. So if you have two frames named &quot;frm_1&quot; and &quot;frm_2&quot; and you have your form in frm_1 then you would use:

&quot;onclick=top.frm_2.location=document.your_form.url.value;&quot;

You should try to familiarize yourself with the DOM, it will really help for dealing with frames and forms.

Hope this helps,
/johnny

 
Thanks soooo much Johnny! You're a life saver!
It works perfectly now.

Cheers, Ginger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top