I am very new to HTML and I am making a web page for my father. I am trying to make a password protected page and I got that working but it will only advance to the password protected page if they click the log in button after entering the password, it will not work if they click enter I was wondering how to make this possible. Also is there a way when the password is entered that it only comes up with circles not the actual password?
here is the code:
Please help if you have time
here is the code:
Code:
<script language="JavaScript" type="text/javascript">
<!--- PASSWORD PROTECTION SCRIPT
function TheLogin() {
var password = '******';
//this is where I place the password to use
if (this.document.login.pass.value == password) {
top.location.href="http://www.*******";
}
else {
location.href="http://www.*******";
}
}
// End hiding --->
</script>
</head>
<body>
<div id="container">
<div style="margin-left:0px;">
<div style="margin-right:50px;">
<center>
Enter your password:<br>
<form name="login" style="margin: 0px">
<INPUT TYPE="text" NAME="pass" size="17" onKeyDown="if(event.keyCode==13) event.keyCode=9;" style="width: 152px; margin: 5px;"><br>
<input type="button" value="Login" style="width : 150px; margin: 3px" onClick="TheLogin(this.form)">
</form>
</center>
Comment