|
Q369 How can I pass the name entered in a text box to a popup window for display when the form button is pressed?
irt.org | Knowledge Base | JavaScript | Window | Q369 [ previous next ]
Q369 How can I pass the name entered in a text box to a popup window for display when the form button is pressed?
In the main window:
<SCRIPT LANGUAGE="JavaScript"><!--
function passData(data) {
windowHandle = window.open('apage.html' + '?' + data,'windowName','resizable=no,width=200,height=200');
}
//--></SCRIPT>
<FORM onSubmit="return false">
<INPUT TYPE="TEXT" NAME="data">
<INPUT TYPE="BUTTON" VALUE="Pass Data" onClick="passData(this.form.data.value)">
</FORM>
|
then in the apage.htm:
<SCRIPT LANGUAGE="JavaScript"><!--
if (location.search.length > 0) document.write('Hi ' + location.search.substring(1));
//--></SCRIPT>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.