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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b0lsc0ttIT ManagerCommented:

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.

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'.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
b0lsc0ttIT ManagerCommented:
ritetek,  Good catch!  That is probably all he needs.

Forced accept.

EE Admin
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.