Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closing child pop-up and refreshing the parent page

I am trying to achieve the following.

  1. A link on a parent page will open a new child pop-up.
  2. In the child pop-up, the user enters some data and clicks “Save”.
  3. Data will be saved to database and the pop-up will be closed. The parent window would be refreshed, and the data entered in the child pop-up would be displayed in the parent page.

How can this (closing a child pop-up and refreshing the parent page) be done in Javascript?

like image 488
cool2cool Avatar asked Feb 28 '11 08:02

cool2cool


1 Answers

In the pop-up window:

<script type="text/javascript">
function proceed(){
   opener.location.reload(true);
   self.close();
}
</script>

<form onsubmit="proceed()">
...
</form>
like image 105
derekcohen Avatar answered Nov 04 '22 22:11

derekcohen