Javascript

Hellow !

Well ,I have one asp page contains iframe inside it.
in that frame frame opens the external URL.
I want to assign the value of textbox of the inner page (the page from external page opening inside the frame )

i used the following javascript

document.getElementById("ifrm").document.getElementsByName("modoOperacao") it shows me the object but

document.getElementById("ifrm").document.getElementsByName("modoOperacao").value  it shows me "undefined"

please let me know how can i solve it.

Thanks you very much.
jd_dobariyaAsked:
Who is Participating?
 
ritetekConnect With a Mentor Commented:
What b0lsc0tt said is correct, however your syntax is incorrect as well.  

The function getElementsByTagName returns a collection of objects, so you can access the first (and most likely, in your case,  the only) object by using array notation.  So, you should replace 'document.getElementById("ifrm").document.getElementsByName("modoOperacao").value' with 'document.getElementById("ifrm").document.getElementsByName("modoOperacao")[0].value'.
0
 
b0lsc0ttIT ManagerCommented:
jd_dobariya,

Is the page with the textbox on a different domain or server than the page where you will place this script?  If so you can't do it.  The browser prevents cross domain scripting like this for security reasons.  Let me know if the pages are on the same server and domain.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
b0lsc0ttIT ManagerCommented:
ritetek,  Good catch!  That is probably all he needs.

bol
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
All Courses

From novice to tech pro — start learning today.