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:
- The data in the form is saved
- The child window closes
- The parent window updates to reflect the new data
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.
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: