Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refreshing a parent window from a child window

Status
Not open for further replies.

GirlFriday1

Programmer
May 1, 2001
20
CA
Hello again! I need to know how to refresh a parent window, using an update button from a child window. This button will update info to the database, close the child window and go back to the parent window, having the parent window showing the new info that was inputted from the child window. Make sense? I know (now) how to pass info to and from the two windows, but that's about it....
I would really appreciate the help!
Thanks!
 
The way I do it is to make the form on the parent page recursive (i.e. -- it submits to itself) -- and I usually run two forms on that parent page -- one for submitting on to the next page -- using hidden variables that are set from the values of the ones that the user enters --

then you just say (from the child window) --

window.opener.formName.submit();

to get it to submit itself and reload the information --

:)
Paul Prewett
 
Why two forms? The only thing that I really need is a user ID to be sent from the parent form to the child form. Once the updates are done to the database from that child form, the update button is clicked and the parent page is automatically refreshed with the new info from the database. Should I include just that user id in my "hidden form"? Any suggestions?
Thanks, again! I owe you 2 now ;)
 
try this:

window.opener.location.reload();
 
Hello! I am almost there! I just have to figure out a way to get rid of that automatic refresh error that makes the user "Retry" to get the new info. Maybe that is what you were talking about a little while ago. I'll give it another go and post the code (if it works!) Thanks again!
 
Try

window.opener.location.replace(window.opener.location.href);
window.opener.focus();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top