Q
Problem solve Get help with specific problems with your technologies, process and projects.

How can I access form fields in iframe through Javascript when clicking an event outside iframe?

On a Web page I am displaying a form using iframe. On clicking one event (outside the iframe), I want to access the form fields (in iframe) through Javascript. Would you please suggest how to do that? Thanks in advance.

To set yourName to the value of the field "yourname" of the myForm form in the iframe, try this.

var iframe = document.getElementById
("myFrame");
var iframeDoc = iframe.Document;   
var iframeForm = iframeDoc.
getElementById("myForm");
var yourName = iframeForm.
yourname.value;

Do you have comments on this Ask the Expert Q&A? Let us know.

Dig Deeper on JavaScript for Lotus Notes Domino

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close