Solved

iframe communication with the parent frame?

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

752 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