-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay14task1.html
56 lines (53 loc) · 1.38 KB
/
Day14task1.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
52
53
54
55
56
<html>
<head>
<link rel="stylesheet" type="text/css" href="login_style.css">
<script type="text/javascript">
var login_attempts=3;
function check_form()
{
var name=document.getElementById("name").value;
var pass=document.getElementById("pass").value;
if(name=="ANANDHAKUMAR" && pass=="SOLLUNGAE")
{
alert("SuccessFully Logged In");
document.getElementById("name").value="";
document.getElementById("pass").value="";
}
else
{
if(login_attempts==0)
{
alert("No Login Attempts Available");
}
else
{
login_attempts=login_attempts-1;
alert("Login Failed Now Only "+login_attempts+" Login Attempts Available");
if(login_attempts==0)
{
document.getElementById("name").disabled=true;
document.getElementById("pass").disabled=true;
document.getElementById("form1").disabled=true;
}
}
}
return false;
}
</script>
</head>
<body>
<div id="wrapper">
<form id="form1" method="post" action="" onsubmit="return check_form();">
<div><center><p id="login_label"><b>LOGIN CREDENTIAL</b></p></center></div>
<label>USER NAME:</label>
<input type="text" id="name" placeholder="Enter Username">
<br>
<Label>PASSWORD:</label>
<input type="password" id="pass" placeholder="Enter Password">
<br>
            <input type="submit" value="SUBMIT FORM">
<br>
</form>
</div>
</body>
</html>