Access iframe element from another iframe present in an div tag

K

karthickdevi

Hi,

I have an iframe , say 'iframe01' in my parent document. In the same
parent document, i have a div tag and inside the div tag, i have
another iframe, say 'iframe02'.
Now i want to access the iframe01 element from the iframe02.
Please suggest me how can i do it.

I have tried the following, but i get as undefined.

from iframe02,,
window.frames[iframe01].document.getElementsByName('textfield')[0].value

Thanks,
Dev.
 
A

ASM

(e-mail address removed) a écrit :
I have tried the following, but i get as undefined.

from iframe02,,
window.frames[iframe01].document.getElementsByName('textfield')[0].value

parent.iframe01.document.getElementsByName('textfield')[0].value

(if each of the 3 files are from same domain)
 
K

karthickdevi

Hi,

Thanks, this worked.

Regards,
Dev.
(e-mail address removed) a écrit :
I have tried the following, but i get as undefined.

from iframe02,,
window.frames[iframe01].document.getElementsByName('textfield')[0].value

parent.iframe01.document.getElementsByName('textfield')[0].value

(if each of the 3 files are from same domain)
 
K

karthickdevi

Hi,

Thanks, this worked.

Regards,
Dev.
(e-mail address removed) a écrit :
I have tried the following, but i get as undefined.

from iframe02,,
window.frames[iframe01].document.getElementsByName('textfield')[0].value

parent.iframe01.document.getElementsByName('textfield')[0].value

(if each of the 3 files are from same domain)
 

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,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top