-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPasswordChange.aspx
More file actions
101 lines (94 loc) · 3.94 KB
/
Copy pathPasswordChange.aspx
File metadata and controls
101 lines (94 loc) · 3.94 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PasswordChange.aspx.cs" Inherits="SITConnect.PasswordChange" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
.auto-style2 {
width: 183px;
}
.auto-style4 {
height: 26px;
}
</style>
<script type="text/javascript">
function pwValidate(e) {
var item = e.nextElementSibling.getAttribute("id");
var str = e.value;
if (str.length < 12) {
document.getElementById(item).innerHTML = "Password length must be at least 12 characters";
document.getElementById(item).style.color = "Red";
return ("too_short");
}
else if (str.search(/[0-9]/) == -1) {
document.getElementById(item).innerHTML = "Password require at least 1 number";
document.getElementById(item).style.color = "Red";
return ("no_number");
}
else if (str.search(/[A-Z]/) == -1) {
document.getElementById(item).innerHTML = "Password require at least 1 upper case character";
document.getElementById(item).style.color = "Red";
return ("no_upper_case");
}
else if (str.search(/[a-z]/) == -1) {
document.getElementById(item).innerHTML = "Password require at least 1 lower case character";
document.getElementById(item).style.color = "Red";
return ("no_lower_case");
}
else if (str.search(/[^a-zA-Z0-9]/) == -1) {
document.getElementById(item).innerHTML = "Password require at least 1 special character";
document.getElementById(item).style.color = "Red";
return ("no_special_character");
}
document.getElementById(item).innerHTML = "Excellent!";
document.getElementById(item).style.color = "Blue";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<h2>Password Change</h2>
<table class="auto-style1">
<tr>
<td class="auto-style2">Old Password</td>
<td>
<asp:TextBox ID="password_tb1" runat="server" Width="200px" onkeyup="pwValidate(this)" required></asp:TextBox>
<asp:Label ID="pwdChecker_lbl1" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">New Password</td>
<td>
<asp:TextBox ID="password_tb2" runat="server" Width="200px" required></asp:TextBox>
<asp:Label ID="pwdChecker_lbl2" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">Confirm Password</td>
<td>
<asp:TextBox ID="password_tb3" runat="server" Width="200px" required></asp:TextBox>
<asp:Label ID="pwdChecker_lbl3" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style4" colspan="2">
<asp:Label ID="error_msg_lbl" runat="server" ForeColor="Red"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="SaveBtn" runat="server" OnClick="SaveBtn_Click" Text="Save Changes" Width="284px" />
</td>
</tr>
</table>
</form>
</body>
</html>