Closing popup refresh parent

I have taken the invite a friend page and modified it so that - instead of sending a mail, it enters data into the database via sql statement. I also changed fields and added a few more.

Now, Everything works fine for the submission and all - I get the confirmation message that data has been input, and checking the database confirmsa this. But now here;s my problem.

After submitting form and getting confirmation message, I need the parent page to be refreshed upon closing the popup, as it needs to update the data on the page that houses the popup link.

In my original coding - non dolphin php script - I could use a body onUnload and it was perfect, but that is not working here. I also tried various javascript commands and even buttons and links just to close the window, but none of them functioned at all (did not close popup)

Any Help would be greatly appreciate4d

Thanks in advance.

caredesign.net
Quote · 22 Feb 2013

OK, heres what i have managed to get to work

in inc/utils.inc.php add:

    function CloseAndRefresh() { 
    opener.location.reload(true); 
    self.close();   
       } 

create duplicate of templates/base/popup.html (i called mine popup-communication.html)

in your duplicated version of the html template,

replace:

<i class="login_ajx_close sys-icon remove"></i>

with:

    <a href="page/blah-blah" onClick="CloseAndRefresh(); return:false;">Close</a>

 

Now - the only problem with this is that if the user does not click the close link, and instead clicks outside of the popup, it will not close and refresh parent page. So, any help with this would be greatly appreciated.

caredesign.net
Quote · 22 Feb 2013

I am not a javascript programmer; don't know that much about it.  However, having said that, is there a way to check for has focus?  So that if the pop-up loses focus (or does it lose focus if you click outside of it?) then the action is done.

I do know that some of the modal boxes on dolphin are not really modal in nature.

Geeks, making the world a better place
Quote · 22 Feb 2013

i found the functions that handle the onhide and stuff for the popups, but I do not know how to properly implement the code to make it work, so - I just told it that a person can not close the popup by clicking outside of the popup, thus forcing them to click my close button. And this is totally fine with what I need it for, but it would be nice if someone found a way to make it happen automatically when clicking outside of the popup. That would be cooler.

caredesign.net
Quote · 22 Feb 2013

 Are you really sure? this even works little bit?

You are defining a js function inside a php file ?????

OK, heres what i have managed to get to work

in inc/utils.inc.php add:

    function CloseAndRefresh() { 
    opener.location.reload(true); 
    self.close();   
       } 

create duplicate of templates/base/popup.html (i called mine popup-communication.html)

in your duplicated version of the html template,

replace:

<i class="login_ajx_close sys-icon remove"></i>

with:

    <a href="page/blah-blah" onClick="CloseAndRefresh(); return:false;">Close</a>

 

Now - the only problem with this is that if the user does not click the close link, and instead clicks outside of the popup, it will not close and refresh parent page. So, any help with this would be greatly appreciated.

 

so much to do....
Quote · 23 Feb 2013

He is reusing the pop-up invite thingy to handle this.

Geeks, making the world a better place
Quote · 23 Feb 2013

Not very sure but you might want this.

Put this in the end of popup.html file you already editing. Revert to original file first.

<script type="text/javascript">
$(function(){
      $('.login_ajx_close').click(function(){
        window.location= window.location;
      });
});
</script>


Lets me know if this is what you wanted.

so much to do....
Quote · 23 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.