Click to See Complete Forum and Search --> : copying elements..


mili
07-28-2003, 05:57 PM
How can I copy elements from one iframe to another?
I have two Iframes and they are nested.
Ther outer Iframe is called main and the innner iframe is called sub.
I want to copy some input text values from sub to main.
Please help me

thanks

pyro
07-28-2003, 07:20 PM
If I understand you correctly, something like this should work:

parent.document.formname.inputname.value = document.formname.inputname.value;

mili
07-28-2003, 07:48 PM
thanks Pyro.
One more question: If I want to submit the form contained in my "sub" iframe from my outer "main" frame, will it work I
say
document.subform.submit(); from my outer Iframe?

pyro
07-28-2003, 09:05 PM
You would need to use something like this:

top.outeriframename.inneriframename.document.formname.submit();

Or you could try (though I'm not certain it will work)

self.inneriframename.document.formname.submit();

If you try the second method, let me know if it works.

mili
07-28-2003, 10:24 PM
Thanks Pyro...I will have to try that tomorrow at work.I will let you know if that works.

Good Night :)

pyro
07-28-2003, 10:29 PM
Ok, sounds good...

mili
07-29-2003, 11:03 AM
The second method works like a charm! Thanks Pyro

pyro
07-29-2003, 11:08 AM
Ok, add that to my mental list of things that will work... ;) lol