469,898 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Need help with forms within different frames.

Hello,

I have to iframes within one page. When I triger action in one frame, I
need to update the content's of other frame's selection list.

How to access second frame's form element from my first frame in index
page?

Suppose I named my second frame "content", and form element is named
simply "form1". If I try to access that form by refering:
parent.content.document.form1, I get nothing at all.

Can anyone help me with that...

Thank you,
Audrius

Sep 14 '05 #1
3 1414
I've managed it by adding a function to my parent frame, which accesses
inner frame's form.

Sep 14 '05 #2
Audrius wrote:
Hello,

I have to iframes within one page. When I triger action in one frame, I
need to update the content's of other frame's selection list.

How to access second frame's form element from my first frame in index
page?

Suppose I named my second frame "content", and form element is named
simply "form1". If I try to access that form by refering:
parent.content.document.form1, I get nothing at all.

Can anyone help me with that...

Thank you,
Audrius


Hi,

Try something like this. (Not tested)
suppose you have 2 pages (page2 as Iframe named myIFrame)

page1.html

<html>
...etc
<form name="page1form" action=".." method="POST">
<input type="text" name="firstname">
</form>
</html>

page2.html
<html>
...etc
<form name="page2form" action=".." method="POST">
<input type="button" value="change page 1" onClick="doit();">
</form>

<script type="text/javascipt">
function doit(){
parent.frames.myIFrame.document.forms.page1form.fi rstname.value="Joe";
}
</script>
</html>
Regards,
Erwin Moller
Sep 14 '05 #3
Thanks for solution. I'll give a try.

Sep 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mekon | last post: by
5 posts views Thread by Charles Harrison Caudill | last post: by
3 posts views Thread by misra.manisha | last post: by
11 posts views Thread by Krzysztof Retel | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.