The JavaScript instructions are shown below in bold.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JavaScript Demo Example 13</title>
<script type="text/javascript" language=JavaScript>
<!--
function Logon(Pw) {
//var Pw = document.pwdrequest.pwd.value;
window.location=Pw + "/home.htm";
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF"
onload="document.pwdrequest.pwd.value = '';document.pwdrequest.pwd.focus()"><!--note
that
two single quotes surround the null value.-->
<h3>Simple password access to protected web pages. <a href="example_13_html.htm">View
source.</a></h3>
<center>
<form name="pwdrequest">
<p><b><font size="+1">Please enter the password and
click on the "Log in"
button below.</font><br> (The password is "havefun" without
the quotes.)</b></p>
<p><b>Password:</b>
<input type="password" name="pwd" size="12"
maxlength="12"
onChange="Logon(document.pwdrequest.pwd.value)"></p>
<input type="button" value="Log in" onClick="Logon(document.pwdrequest.pwd.value)">
</form>
</center>
<p> </p>
<p><a href="index.htm">Return to Having Fun with JavaScript</a>.</p>
</body>
</html>
Return to Example 13 alternate.