You are here: irt.org | FAQ | JavaScript | Password | Q307 [ previous next ]
In the main document:
<SCRIPT LANGUAGE="JavaScript"><!-- function windowOpen() { var myWindow=window.open('popup.html','windowRef','width=200,height=200'); myWindow.location.href = 'popup.html'; if (!myWindow.opener) myWindow.opener = self; } windowOpen(); //--></SCRIPT>
And then in the popup.html document:
<SCRIPT LANGUAGE="JavaScript"><!-- function returnDetails() { opener.location.href = 'whatever.cgi?login=' + escape(document.myForm.loginname.value) + '&password=' + escape(document.myForm.loginpassword.value); setTimeout('window.close()',500); } //--></SCRIPT> <FORM NAME="myForm"> Name: <INPUT TYPE="TEXT" NAME="loginname"> Password: <INPUT TYPE="PASSWORD" NAME="loginpassword"> <INPUT TYPE="BUTTON" VALUE="ENTER" onClick="returnDetails()"> </FORM>