52 users online (0 members and 52 guests)  


  Results 1 to 4 of 4

Related

  1. Popup-like window    Forum: HTML Forum
    Replies: 0
  2. positioning a popup window    Forum: HTML Forum
    Replies: 1
  3. popup window    Forum: HTML Forum
    Replies: 1
  4. Popup Window    Forum: HTML Forum
    Replies: 2
  5. Popup window to fit?    Forum: HTML Forum
    Replies: 1
  1. #1
    VirtualOdin's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    London, England
    Posts
    3

    Refreshing a window on return from a popup

    OK, I have a complex user form run with PHP with results stored in MySQL. Most user actions are done on the one .php page. 'Submit' refers to the same page and various scripts to do what is needed as a result of user input. So far so good.

    The page is getting quite large and complex, so for a couple of user interventions I want to throw up a small window (easy enough), collect the extra data from a few fields and save it to the database (also easy enough), but when it's done I want the pop-up to close and the main page to refresh.... This last bit I cannot manage.

    All I can manage is either the pop-up closes and the main page is as it was or the pop-up loads the main page (a mess because of the different sizes and now two windows are open and I want only one. I do not want the depricated refresh to run all the time. It just needs to be the once when the main window return to focus.

    I am using a button for the final action like this
    <input type='button' value='Data saved...' onClick=\"window.close(), window.open('".$url."', '_self');\">

    I have tried _blank and _top. They do different things but not what I want. Am I on the wrong track? Any advice gratefully accepted...

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hey, welcome to the forum.
    I got this working with this:

    Code:
    <input type="button" onclick="window.opener.location.reload(); self.close();" value="close & refresh">
    I was playing with it here:
    http://www.quietdean.com/demo/refresh.php

    As you can see, it seems to work fine.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Welcome

    I think we have a new record, 1 1/2 year member making his/her first post. I hope your record stands for a long long time

    Dave

  4. #4
    VirtualOdin's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    London, England
    Posts
    3
    Thank you so much QuietDean. Excactly what I needed. Works a treat. And Dave, I'll be back with such a rapid and successful post...



Tags for this Thread