Solved

iframe communication with the parent frame?

Posted on 2009-07-03
3
513 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 50 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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult 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…

756 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