Updating Parent Page From Child Page

Updating the parent page from the child page using javascript, is a very straight process. I have outlined very simply the steps below:

In this example, I am going to post data back to the parent from the child page.
In order to set the post parameters you would like posted to the page, set your variables first like so

window.opener.document['formName'].variableName.value=theValue

This bit of code basically sets the variableName with a specific value on the parent window. Once you have done this for all the variables you need to post to the page, you want to submit the variables. This can be accomplished with:

window.opener.document.formName.submit();

If you need to refresh the parent window from the child, just use window.opener.reload().

A very simple way to post data to the parent.

4 Responses

Subscribe to comments with RSS, or TrackBack to 'Updating Parent Page From Child Page'.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>