Skip to main content
February 26, 2009
Question

How to refresh parent window?

  • February 26, 2009
  • 3 replies
  • 1473 views
Howdy,

i open a open child window using window.open.

once stuff is done in child window....user can close it by pressing close button or X on top right.

When they close child window, i want to refresh parent window and show changes from child window in parents window.
How to do this?
    This topic has been closed for replies.

    3 replies

    Inspiring
    March 2, 2009
    I have the same problem before and used this code and I use onclick event on the close button :
    Inspiring
    March 2, 2009
    quote:

    Originally posted by: dchard
    I have the same problem before and used this code and I use onclick event on the close button :

    What happens if you close the pop-up another way? There are at least 2 that I can think of.
    Inspiring
    March 1, 2009
    google "javascript refresh parent"
    Inspiring
    March 1, 2009
    hi,

    That's a javascript issue.

    Here are some functions that I usually use for things like that:

    function opener_get_element(id) {
    var object = null;
    object= window.opener.document.getElementById(id);
    return object;
    }

    function opener_set_value(id, value){
    if (opener_get_element(id))
    opener_get_element(id).value= value;
    }
    function opener_refresh(formid){
    opener_get_element(formid).submit();
    }

    cheers,
    fober