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

Q216 In a popup window how can I submit a form, close the popup window and target the results of the form into the main window?

irt.org | Knowledge Base | JavaScript | Form 10.3 | Q216 [ previous next ]

Q216 In a popup window how can I submit a form, close the popup window and target the results of the form into the main window?

Use a timer to close the window, and add a TARGET to the form:

<form action="apage.html" target="mywindowname" onSubmit="setTimeout('window.close()',2000)">
<input type="submit">
</form>

Now make sure that in the main window you set its name (by default the main window has no name):

<script language="JavaScript"><!--
window.name="mywindowname"; // will not work in Netscape Navigator 2 as name is read only
//--></script>

Feedback on 'Q216 In a popup window how can I submit a form, close the popup window and target the results of the form into the main window?'


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.