You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
showError(firstNameEl,'First name cannot be blank.');
19
+
}elseif(!isBetween(firstname.length,min,max)){
20
+
showError(firstNameEl,`First name must be between ${min} and ${max} characters.`)
21
+
}else{
22
+
showSuccess(firstNameEl);
23
+
valid=true;
24
+
}
25
+
returnvalid;
26
+
};
27
+
28
+
constcheckLastname=()=>{
29
+
letvalid=false;
30
+
constmin=3,max=25;
31
+
constlastname=lastNameEl.value.trim();
32
+
33
+
if(!isRequired(lastname)){
34
+
showError(lastNameEl,'Username cannot be blank.');
35
+
}elseif(!isBetween(lastname.length,min,max)){
36
+
showError(lastNameEl,`Username must be between ${min} and ${max} characters.`)
37
+
}else{
38
+
showSuccess(lastNameEl);
39
+
valid=true;
40
+
}
41
+
returnvalid;
42
+
};
43
+
44
+
constcheckUsername=()=>{
45
+
46
+
letvalid=false;
47
+
// length of the username
48
+
constmin=3,max=25;
49
+
50
+
constusername=userName.value.trim();
51
+
52
+
if(!isRequired(username)){
53
+
showError(userName,'Username cannot be blank.');
54
+
}elseif(!isBetween(username.length,min,max)){
55
+
showError(userName,`Username must be between ${min} and ${max} characters.`)
56
+
}else{
57
+
showSuccess(userName);
58
+
valid=true;
59
+
}
60
+
returnvalid;
61
+
};
62
+
63
+
64
+
constcheckEmail=()=>{
65
+
letvalid=false;
66
+
constemail=emailEl.value.trim();
67
+
if(!isRequired(email)){
68
+
showError(emailEl,'Email cannot be blank.');
69
+
}elseif(!isEmailValid(email)){
70
+
showError(emailEl,'Email is not valid.')
71
+
}else{
72
+
showSuccess(emailEl);
73
+
valid=true;
74
+
}
75
+
returnvalid;
76
+
};
77
+
78
+
constcheckPassword=()=>{
79
+
letvalid=false;
80
+
81
+
82
+
constpassword=passwordEl.value.trim();
83
+
84
+
if(!isRequired(password)){
85
+
showError(passwordEl,'Password cannot be blank.');
86
+
}elseif(!isPasswordSecure(password)){
87
+
showError(passwordEl,'Password must has at least 8 characters that include at least 1 lowercase character, 1 uppercase characters, 1 number, and 1 special character in (!@#$%^&*)');
0 commit comments