Forums

This topic is locked

Parent Refresh From Pop-up window

Posted 21 May 2003 08:51:12
1
has voted
21 May 2003 08:51:12 Mike Sal posted:
Hi, Can someone go into a bit more detail about this code ( posted by george ) to help me refresh a parent window from a pop-up window......

HERE IS WHAT HE SAYS............

Question:


--------------------------------------------------------------------------------
Is it possible to close the advanced popup window on the submission of a form, and have the page it was called from refresh, to display the results just submitted?




Answer:


--------------------------------------------------------------------------------

1. Make a RedirectChildWindow.htm file containing:
MY QUESTION ABOUT THIS IS ....... Is this just the pop-up window and does the javaScript go my already created pop-up window OR is this a new file I need to create ?

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
window.opener.progressWindow.close();
window.close();
}
//-->
</script>
</head>

<body onLoad="refreshParent()">
</body>
</html>

2. Put this file in the popup window as a redirect at your Insert/Update record SB
MY QUESTION HERE IS..........
How do I write this as a re-direct ?
Thats it!
I am adding info to a database from a pop-up ( ADD_TECH_CATEGORY.asp ) and need the parent to refresh to show the new added data on the parent page (ADD_TECH.asp)

Thanks for the help



"A developer in the making"

Replies

Replied 21 May 2003 09:49:33
21 May 2003 09:49:33 Vince Baker replied:
Many applications I have created use the exact feature you require.

Here is the code that I always use:

onclick="opener.location='URL_Page_Name'"

This can obviously be changed to onUnload or anyother action.

From my main page, I open a popup and the have this script on either a close window hyperlink.

This code closes the popup and then rerfreshes the main window.

If your popup has an insert for example and you then go to a confirmation message, attach the behaviour to a close window link and this will again close the popup and refresh the main window.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic