Solved

iframe communication with the parent frame?

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now