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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect and Refresh?

Status
Not open for further replies.

calista

Programmer
Joined
Jan 24, 2001
Messages
545
Location
US
I have a template that displays a table of IP addresses and additional information about that address. When the user clicks on an address, a new window opens with a form to edit one of the fields. When the user submits the form, he gets a success message and a button to close the window. OK, so far. What I want to happen is, when the user closes the form window, I want the first page to refresh, so that the user's changes are visible.

Here is a portion of my form window after the form has been processed:

<!--- Display sucess message to user. --->
<CFOUTPUT>
<FONT SIZE=&quot;+2&quot; COLOR=&quot;Green&quot;>
Thank you, #GetUser.PersonFirstName#!<BR><BR>
Your request has been processed.<BR>
</FONT>
</CFOUTPUT>

<form>
<input type=button value=&quot;Close Window&quot; onClick=&quot;javascript:window.close();&quot;>
</form>

How do I close the window, and refresh the first page? Thanks!
Calista :-X
Jedi Knight,
Champion of the Force
 
This may work on the pop up page in a javascript block

<script language=&quot;javascript&quot; >

document.window.returnvalue = 'changed';

</script>

in the calling page:

<a onclick=&quot;if( window.open('youpage.cfm') returnvalue == 'changed' ) document.replace('pagetorefresh.cfm');&quot; >

something along those lines - i have code that does this at work if this doesnt work i'll have a look at it tommorow.

HTH

Kola
 
try using opener property of the window object, e.g.:

window.opener.location.href = &quot;
this will set the new location for the window object containing the open() method used to open the current window; take this one step further and you can do something like this:

window.opener.location.href = &quot;<cfoutput>#cgi.http_referer#</cfoutput>&quot;;


Sylvano
dsylvano@hotmail.com
 
WWebSpider's got the right idea, I think.

If the popup window doesn't know the URL to set the location of the caller window to, it can determine it by getting the value of the current location for that window. Maybe this would work:

window.opener.location.href = window.opener.location.href;

Or, maybe you have to do this in two statements.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top