You are here: irt.org | FAQ | JavaScript | Form | 10.3 | Q408 [ previous next ]
In the main window:
<script language="JavaScript"><!-- function windowOpen() { var myWindow=window.open('popup.html','windowRef','width=200,height=200'); if (!myWindow.opener) myWindow.opener = self; } windowOpen(); //--></script> <form action="nextpage.html"> <input type="text" value="" name="output"> </form>
In the poup.html dowcument:
<script language="JavaScript"><!-- function updateOpener() { opener.document.forms[0].output.value = document.forms[0].input.value; opener.document.forms[0].submit; window.close(); } //--></script> <form onSubmit="updateOpener()"> <input type="text" value="" name="input"> <input type="submit"> </form>