This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes access a parent's form in an iframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "access a parent Watch "access a parent New topic

access a parent's form in an iframe

Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hello all,

I have a jsp page with an IFrame. The jsp page has a form A assigend to it and the IFrame has a Form B assigned to it.

Now, I need to use a property of Form A in the IFrame. Is it possible to do this? Thanks!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm not entirely sure what you mean by "property", but you can certainly use JavaScript inside the IFrame to reference anything in the enclosing frame. Just use "parent" before the element. For example, If I want to get the value of a text input named "customerID" in the enclosing frame, reference it with parent.document.myForm.customerID.value.

Consultant, Sima Solutions
I agree. Here's the link:
subject: access a parent's form in an iframe
Similar Threads
JSP and IFrames
change the iframe height dynamically in a jsp page
iframe refreshing another iframe
How to avoid 2nd form submission in case the First one is submitted and vice versa?
How to stop Flash Screen?