|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi guys I have a problem(again)
I have 3 .html files: 1. creates 2 vertical frames 2. creates 2 horizontal frames in the right frame of 1. 3. creates 2 vertical frames in the bottom frame of 2. Now In the document of frame 2a I want to create a textbox and button where the user can type in a url and by pressing on the button the requested url will load in the frame. I tried this: </script> <SCRIPT LANGUAGE="JavaScript"> function testResults (form) { var TestVar = form.textfield.value; parent.frame2B.Frame3B.src=TestVar; } </SCRIPT> and in the body: <form name="a" method="get" action="" Target="main"> <input type="text" Value="http://www.yahoo.com" name="textfield" size=50> <input type="submit" name="Submit" value="go" onClick="testResults(this.form)" > </form> But this doesn't work. I tried everything I could think of, and looked everywhere, so If any of you could help me, I'd be much obliged. Thanks Primal Fear |
|
#2
|
|||
|
|||
|
Well first of all your form isnt going to work the way you have it and id modify the script a bit too.
Try this instead: <script language="JavaScript"> function go(){ URL = document.myForm.theURL.value; parent.framename.location=URL; } </script> Just change "framename" to the name of the frame you are trying to load this in. <form name="myForm"> <input type="text" name="theURL" size="50"> <input type="button" value="Go" onClick="go()"> </form> That should work. Spookster |
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > Loading a new document in a frame using javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|