-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
57 lines (51 loc) · 1.9 KB
/
scripts.js
File metadata and controls
57 lines (51 loc) · 1.9 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
function f_show_group_list(obj) {
document.getElementById("request_table").style.display = "none";
var numGroup = obj.innerHTML;
var names = document.getElementsByClassName("group_table");
for (var i = 0; i < names.length; i++) {
if (!numGroup.localeCompare(names[i].innerHTML)) {
names[i].parentElement.style.display="block";
} else {
names[i].parentElement.style.display="none";
}
}
}
function f_show_group_form() {
if (document.getElementById("no_groups") != null) {
document.getElementById("find_group_form").style.display = "block";
}
}
function f_show_requests() {
document.getElementById("request_table").style.display = "block";
var names = document.getElementsByClassName("group_table");
for (var i = 0; i < names.length; i++) {
names[i].parentElement.style.display="none";
}
}
function f_show_attempts() {
document.getElementById("attempt_table").style.display = "block";
}
function f_validate_form(form) {
const login = form.elements['login'].value;
const surname = form.elements['surname'].value;
const name = form.elements['name'].value;
const second_name = form.elements['secname'].value;
const password = form.elements['password'].value;
var firstCheck = true;
var secondCheck = true;
var thirdCheck = true;
if (login.length === 0 || surname.length === 0 || name.length === 0 ||
second_name.length === 0 || password.length === 0) {
document.getElementById("all_empty").style.display = "block";
firstCheck = false;
}
if (login.length < 3 || login.length > 14) {
document.getElementById("login_length").style.display = "block";
secondCheck = false;
}
if (password.length < 4) {
document.getElementById("password_length").style.display = "block";
thirdCheck = false;
}
return firstCheck && secondCheck && thirdCheck;
}