Results 1 to 4 of 4
04-06-2005, 06:04 PM #1
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...
04-06-2005, 07:23 PM #2
Hey, welcome to the forum.
I got this working with this:
<input type="button" onclick="window.opener.location.reload(); self.close();" value="close & refresh">
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?
04-06-2005, 07:41 PM #3
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
04-07-2005, 01:35 AM #4
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...