Forms controlling other frames

I have a web page which has 2 frames

in fact one is an iframe on a page.

On the main page there is a form and a submit button, can i make the submit button change the page in the iframe?
LVL 1
Matthew TandyAsked:
Who is Participating?
 
prsupriyaCommented:
Hello...

In the main page form tag write the target as iframe name and give the action filename.

Example:

<form name="frm1" action="test.html" method="post" target="Ifrm">
 <input type="submit" name="submit" value="submit">
</form>
 
<iframe src="test2.html" name="Ifrm">

</iframe>

Hope this helps...
S:
0
 
COBOLdinosaurCommented:
Sure:

<input type="submit" onclick="top.frames['nameofframe'].location.href='newpage.htm'">

Cd&
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.