-
Notifications
You must be signed in to change notification settings - Fork 0
/
login1.html
51 lines (49 loc) · 1.6 KB
/
login1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script type = "text/javascript">
var count = 2;
function validate() {
var un = document.myform.username.value;
var pw = document.myform.pword.value;
var valid = false;
var unArray = ["kalyan"];
var pwArray = ["kalyan"];
for (var i=0; i <unArray.length; i++) {
if ((un == unArray[i]) && (pw == pwArray[i])) {
valid = true;
break;
}
}
if (valid) {
alert ("Login was sucessfully processed. You will be redirected to the billing page now.");
window.location = "billingwithamtwords.html";
return false;
}
var t = " tries";
if (count == 1) {t = " try"}
if (count >= 1) {
alert ("Invalid username and/or password. You have " + count + t + " left.");
document.myform.username.value = "hello";
document.myform.pword.value = "hello";
setTimeout("document.myform.username.focus()", 25);
setTimeout("document.myform.username.select()", 25);
count --;
}
else {
alert ("Still incorrect! You have no more tries left!");
document.myform.username.value = "No more tries allowed!";
document.myform.pword.value = "";
document.myform.username.disabled = true;
document.myform.pword.disabled = true;
return false;
}
}
</script>
<form name = "myform"><br><br>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style2.css" rel="stylesheet" type="text/css" />
<h1><center>LOGIN PAGE</h1></center>
<br><br><br>
<h3><center>
<p>ENTER USER NAME<br> <input type="text"name="username"><br><br><br<br><br><br>ENTER PASSWORD<br><input type="password" name="pword"><br><br><br>
<input type="button" value=" login " name="Submit" onclick= "validate()">
</h3></p></center>
</form>