-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup_lawyer_script.js
46 lines (38 loc) · 1.24 KB
/
signup_lawyer_script.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
const prevBtns = document.querySelectorAll(".btn-prev");
const nextBtns = document.querySelectorAll(".btn-next");
const formSteps = document.querySelectorAll(".form-container");
// const progressSteps = document.querySelectorAll(".progress-step");
let formStepsNum = 0;
nextBtns.forEach((btn) => {
btn.addEventListener("click", () => {
formStepsNum++;
updateFormSteps();
updateProgressbar();
});
});
prevBtns.forEach((btn) => {
btn.addEventListener("click", () => {
formStepsNum--;
updateFormSteps();
updateProgressbar();
});
});
function updateFormSteps() {
formSteps.forEach((formStep) => {
formStep.classList.contains("form-active") &&
formStep.classList.remove("form-active");
});
formSteps[formStepsNum].classList.add("form-active");
}
// function updateProgressbar() {
// progressSteps.forEach((progressStep, idx) => {
// if (idx < formStepsNum + 1) {
// progressStep.classList.add("progress-step-active");
// } else {
// progressStep.classList.remove("progress-step-active");
// }
// });
// const progressActive = document.querySelectorAll(".progress-step-active");
// progress.style.width =
// ((progressActive.length - 1) / (progressSteps.length - 1)) * 100 + "%";
// }