|
Q408 How can I change a value on a form on the original window from a button in a popup window, submit this form, and close the popup window in one step?
irt.org | Knowledge Base | JavaScript | Form 10.3 | Q408 [ previous next ]
Q408 How can I change a value on a form on the original window from a button in a popup window, submit this form, and close the popup window in one step?
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>
|
Feedback on 'Q408 How can I change a value on a form on the original window from a button in a popup window, submit this form, and close the popup window in one step?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.