Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iframe communication with the parent frame?

Posted on 2009-07-03
3
Medium Priority
?
524 Views
Last Modified: 2012-08-13
If I have a small html form in an iframe, can the outside frame tell whether that form has been submitted?
0
Comment
Question by:tpchai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
Opalelement earned 200 total points
ID: 24774248
If the frame src is on the same server as the parent, you can make the frame run a function when the form is submitted. If they are on different servers, you will have alot more issues.

[iframe code]
<form onsubmit="parent.function();">
[/iframe code]
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 24775485
tpchai,

When will you check?  If you want to know right when the form is submitted then the expert above's suggestion is best.  If you want to find this out at some other point then you could probably use different code.  For example the outside frame would know the form was submitted when it looks for the page name of the page in the frame or its contents.  If the latter is the case and you want details then please let me know what happens when you submit the page.

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

b0lsc0tt
0
 

Author Closing Comment

by:tpchai
ID: 31599665
Thanks, I just need a button to change in the parent frame, this worked fine.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question