-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration.html
113 lines (104 loc) · 3.9 KB
/
registration.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enroll to Zentica</title>
<link rel="stylesheet" href="/static/css/styles.css"> <!-- Link to CSS file for styling -->
<style>
.dropdown {
position: relative;
display: inline-block;
}
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 8px;
font-size: 16px;
border: navy;
cursor: pointer;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content input[type="checkbox"] {
margin: 5px;
cursor: pointer;
}
.dropdown-content label {
margin-left: 5px;
cursor: pointer;
}
.dropdown:hover .dropdown-content {
display: block;
}
</style>
<script>
// Sample array of items
const items = ["Healthcare", "Education", "Technology", "Hospitality", "Finance", "Retail", "Transportation", "Professional", "Arts", "Manufacturing", "Marketing", "Public", "Retail", "Agriculture", "Environmental", "Other"];
// const consoleElement = document.getElementById('output');
// console.log("console element test:", consoleElement)
function populateDropdown() {
const container = document.getElementById("dropdown-content");
items.forEach(item => {
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.id = item;
checkbox.value = item;
checkbox.onclick = handleSelection;
const label = document.createElement("label");
label.htmlFor = item;
label.textContent = item;
container.appendChild(checkbox);
container.appendChild(label);
container.appendChild(document.createElement("br"));
});
}
function toggleDropdown() {
const dropdownContent = document.getElementById("dropdown-content");
dropdownContent.style.display = dropdownContent.style.display === 'block' ? 'none' : 'block';
}
// Function to handle checkbox selection
var selectedItems = [];
function handleSelection(event) {
if (event.target.checked) {
selectedItems.push(event.target.value);
} else {
selectedItems = selectedItems.filter(item => item !== event.target.value);
}
console.log("selected items are:", selectedItems)
}
// Initialize dropdown on page load
window.onload = populateDropdown;
</script>
</head>
<body>
<div class="form-container">
<form id="registrationForm">
<h2>Enroll to Zentica</h2>
<div class="input-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required >
</div>
<!-- <div class="input-group">
<label for="profile">Monetizing category:</label>
<input type="text" id="profile" name="profile" required>
</div> -->
<div class="dropdown">
<button onclick="toggleDropdown()" class="dropbtn">Ideal Sectors</button>
<div id="dropdown-content" class="dropdown-content">
<!-- Checkbox items will be added here dynamically -->
</div>
</div>
<button type="submit">Register</button>
<!-- <a href="/static/genie.html"></a> -->
</form>
</div>
<script src="/static/js/script.js"></script>
</body>
</html>