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

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>

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.