-
Notifications
You must be signed in to change notification settings - Fork 0
/
signupForm.js
executable file
·58 lines (58 loc) · 1.98 KB
/
signupForm.js
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
var s="studentFields";
var t="teacherFields";
var h="hubFields";
var arr1=document.getElementsByClassName(s);
var arr2=document.getElementsByClassName(t);
var arr3=document.getElementsByClassName(h);
for(let i=0;i<arr2.length;i++){
arr2[i].classList.add('hideBlocks');
}
for(let i=0;i<arr3.length;i++){
arr3[i].classList.add('hideBlocks');
}
function formType(){
var x=document.getElementById('dropdownForm');
console.log(x.value);
if(x.value==s){
for(let i=0;i<arr1.length;i++){
if(arr1[i].classList.contains('hideBlocks')==true)
arr1[i].classList.remove('hideBlocks');
}
for(let i=0;i<arr2.length;i++){
if(arr2[i].classList.contains('hideBlocks')==false)
arr2[i].classList.add('hideBlocks');
}
for(let i=0;i<arr3.length;i++){
if(arr3[i].classList.contains('hideBlocks')==false)
arr3[i].classList.add('hideBlocks');
}
}
else if(x.value==t){
for(let i=0;i<arr2.length;i++){
if(arr2[i].classList.contains('hideBlocks')==true)
arr2[i].classList.remove('hideBlocks');
}
for(let i=0;i<arr1.length;i++){
if(arr1[i].classList.contains('hideBlocks')==false)
arr1[i].classList.add('hideBlocks');
}
for(let i=0;i<arr3.length;i++){
if(arr3[i].classList.contains('hideBlocks')==false)
arr3[i].classList.add('hideBlocks');
}
}
else{
for(let i=0;i<arr3.length;i++){
if(arr3[i].classList.contains('hideBlocks')==true)
arr3[i].classList.remove('hideBlocks');
}
for(let i=0;i<arr2.length;i++){
if(arr2[i].classList.contains('hideBlocks')==false)
arr2[i].classList.add('hideBlocks');
}
for(let i=0;i<arr1.length;i++){
if(arr1[i].classList.contains('hideBlocks')==false)
arr1[i].classList.add('hideBlocks');
}
}
}