Reputation: 9322
All,
This should be a pretty simple question, but I haven't found quite the answer I'm looking for yet.
I have a parent HTML window. When a user clicks a button on that window, it opens a child window (e.g., "childA.asp")
That child window includes a form. Here's what I'd like to happen when the user submits that form:
How can I implement this?
Should the form on childA.asp post the data to another page (e.g., "childB.asp"), which saves the data, then calls a JavaScript function on the parent window notifying it to update, then close itself?
If so, how would you do this?
Many thanks in advance.
Upvotes: 3
Views: 2034
Reputation: 413866
Javascript code in your child page can refer to the parent page via window.opener
. Thus what could happen is this:
The "result" page is either the original form with errors, or else a little page with just a <script>
block to do:
window.opener.timeToReloadYourself();
window.close();
Upvotes: 3