Friday, April 13, 2018

Three Times Password in JavaScript

Here is a simple script to allow the user to give username and password at least three times. The code is very simple and easy to understand.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

pass.htm

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Three Times Password in JavaScript</title>
<script language="JavaScript">
numberTimes=0
function checkpassword(){
if (numberTimes== 3){
alert("You have entered wrong password for three times, you must not use this system anymore!")
window.close();
}
else{
if((document.myForm.username.value == "123")&&(document.myForm.myPassword.value == "123"))
{
alert("Password Correct!")
window.location="http://www.jakerpomperada.blogspotcom";
            }
else{
numberTimes=numberTimes+1
alert("Wrong password, please try again!")
return false
}
}
}
</script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body>
<h2> Three Times Password in JavaScript </h2>
<br>
<form name="myForm" method="post">
  <div align="center"><p>&nbsp;</p><br>
Username:
<input name="username" type="text"><br>
Password:
<input name="myPassword" type="password"><br>
<input type="button" name="submit" value="Submit" onClick="checkpassword();">
  </p>
<br>
    <p>If you enter wrong password for three times, </p>
    <p>you will be not allowed to use this system anymore! </p>
  </div>
</form>
</body>

</html>

No comments:

Post a Comment