Need help with forms within different frames.

A

Audrius

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
 
A

Audrius

I've managed it by adding a function to my parent frame, which accesses
inner frame's form.
 
E

Erwin Moller

Audrius said:
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.firstname.value="Joe";
}
</script>
</html>


Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top