We help IT Professionals succeed at work.
Get Started

Access Values from iframe in parent window

695 Views
Last Modified: 2012-05-05
Hi Experts,

in my parent window I have some static text and an iframe. I want to populate the value of a label in the parent window from a field in my iframe. Not sure how to do this. Had a look on the net seems to be using the DOM. Can't get the right syntax. My main page is called plasmamain.html and within this I have an iframe to a page called visitorsView.aspx. I want to get the value from a text box called txtName from the visitorsView.aspx and assign the value of my label on the parent page i.e. plasmamain.html with this value something to the effect of

lblName.text = document.getelementbyID.('visitorsView').txtName.value.

the iframe code on the parent page is as follows:
<iframe id="IF" scrolling="no"
            frameborder="0" src="visitorsView.aspx"></iframe>
Comment
Watch Question
Software Architect in .Net
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE