forked from sanoob-ks/facebook-loginpage-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
59 lines (53 loc) · 1.74 KB
/
script.js
File metadata and controls
59 lines (53 loc) · 1.74 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
function checkPasswordStrength() {
var number = /([0-9])/;
var alphabets = /([a-zA-Z])/;
var special_characters = /([~,!,@,#,$,%,^,&,*,-,_,+,=,?,>,<])/;
var password = $('#password').val().trim();
if (password.length < 6) {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('weak-password');
$('#password-strength-status').html("Weak (should be atleast 6 characters.)");
} else {
if (password.match(number) && password.match(alphabets) && password.match(special_characters)) {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('strong-password');
$('#password-strength-status').html("Strong");
}
else {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('medium-password');
$('#password-strength-status').html("Medium (should include alphabets, numbers and special characters.)");
}
}
}
/*
$(document).ready(function(){
$("#signupForm").validate({
rules:{
mobNumber:{
required:true,
minlength:3,
maxlength:100
},
password:{
required:true,
minlength:6,
maxlength:100,
/*useLowercase:true,
useUppercase:true,
useNumbers:true,
useSpecial:true
}
},
messages:{
password:{
required:"Required",
minlength:"min 6 character needed",
useLowercase:"need lowercase",
useUppercase:"need uppercase",
useNumbers:"need number",
useSpecial:"need special character"
},
}})
}
) */