CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 popup windows after update close and refresh paren

Print topic Send  topic

Author Message
wanaka
Posted: 01/13/2004, 1:21 AM

From my popup windows submit button I have added this

<!-- BEGIN Button Button_Update --><input name="{Button_Name}" type="submit" value="Submit" onclick="opener.location.reload();self.close()"><!-- END Button Button_Update -->

But instead of doing a update first and close the popup windows and refresh parent, it straight away just close the popup windows and refresh parent.

Edd
Posted: 01/13/2004, 3:23 AM

The javascipt fires 1st as it is at the client.

Create a Dummy HTML page. Add a javascript function that calls the opening page and closes the window. In the Body section of the HTML add the "onload" event to call that function.

Now go back to your popup window - get rid of the onclick event and in the Return page of the form point the form to the dummy HTML page.

This allows the page to complete it's submission then redirect's itself to the Dummy HTML Page which on loading calls the javascript function which fires the reload script and then closes.

Phew....


Good luck.
Edd

www.syntech.com.au
EMG
Posted: 01/13/2004, 9:52 AM

The correct way to do this is to put this script in the after_update server event:

die( "<script>window.opener.location.reload();window.close();</script>");

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.