Forum Moderators: open

Message Too Old, No Replies

Close Popup window and refresh Main window

Lots of info, none of it helpful!

         

bateman_ap

3:19 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, been searching for ages now and nothing seems to work for me. What it is I have a popup window where the user fills in the form, this is then submitted to itself, checked and if all works out performs a SQL insert.

All this works however what I want to now do is auto close the popup and get the main window it was spawned from to refresh so the new data can be shown.

All I can do is close the window using:
<script language="javascript">
self.close()
</script>

I have tried putting
parent.refresh() in there but it doesn't work

Any ideas? My Javascript knowledge is appaling so easy as possible :-)

RonPK

3:23 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many browsers support the reload() method. The opening window can be referred to as window.opener.

All that means that

window.opener.location.reload(); 
window.close();

should do the trick.

bateman_ap

3:23 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Fantastic, thanks a mill