Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1235 How do I close a popup window after submitting a form from it?

irt.org | Knowledge Base | JavaScript | Window | Q1235 [ previous next ]

Q1235 How do I close a popup window after submitting a form from it?

Tuomas Salo writes:

The problem is how to close the popup window on the right moment.

My solution is:

- When submitting a form in a popup window, target the form into the popup window, not the main window.
- The script that the data was sent to will print a simple page to the popup window, something like this:

To just refresh the main window:

<html>
  <body
    onLoad="opener.location.href=opener.location.href; window.close();">
  </body>
</html>

Or maybe go to a different page:

<html>
  <body
    onLoad="opener.location.href='another.html'; window.close();">
  </body>
</html>

Feedback on 'Q1235 How do I close a popup window after submitting a form from it?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.