Click to See Complete Forum and Search --> : refresh a frame from a pop-up


cipi
07-08-2003, 03:53 AM
Hello (first post, probably not the last)

I have a page with 3 frames: topFrame,mainFrame,bottomFrame

From the mainFrame I want to open a pop-up in witch I want to introduce some data into a database and after all is done I want to show a button “Close and refresh”. When you click on this button the pop-up should close and the mainframe refresh?

I tried the “opener” method but it does not work because I do some processing in the pop-up (I verify the values entered into the database and then redirect to the same page but with different results- using querystring)

Thanks

Nevermore
07-08-2003, 05:19 AM
You could use onunload = parent.(framename).refresh(); in the opened window's body tag.

Charles
07-08-2003, 05:53 AM
Originally posted by cijori
You could use onunload = parent.(framename).refresh(); in the opened window's body tag. You might get by with onunload = parent.framename.refresh but I think that it's going to have to be onunload = function () {parent.framename.refresh()}. cijori's example will refresh the frame at parse time and then assign the returned value to the "onload" handler. If you want to refresh the page before the page is fully loaded then just use parent.framename.refresh().

cipi
07-08-2003, 08:02 AM
I tryed the next


In the pop-up;


<body bgcolor="#000000" onunload = parent.mainFrame.refresh();>


I have also a button like:

<form>
<input type="button" onClick="window.close();" value="Close and reload">
</form>

When I push close the mainframe does not refresh.
I tried also to close the page from the X button in the upper right of the window but the frame doesnot refresh

Charles
07-08-2003, 08:07 AM
Ignore what I wrote above, I mis-read cijori's post. I think that you want to refresh the frame "onunload"

requestcode
07-08-2003, 08:14 AM
You could also try this:
<form>
<input type="button" onClick="opener.parent.mainFrame.location.reload();window.close();" value="Close and reload">
</form>

Since you are doing this from a popup I believe you will need to use the term "opener" to refer to the window that opened the popup.

cipi
07-08-2003, 08:38 AM
You are the man

By the way witch is the difference between refresh method and reload method.
Can I use refresh to reload

Thanks