-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathvolunteer-mailing-list.html
More file actions
169 lines (155 loc) · 6.14 KB
/
volunteer-mailing-list.html
File metadata and controls
169 lines (155 loc) · 6.14 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{{ define "main" }}
<div class="mailing-list">
<a href="/"
><img
src="/images/ccss-logo-2022.png"
alt="Carleton Computer Science Society Logo"
class="mailing-list__logo"
/></a>
<img
src="/images/slideshow/orientation.jpeg"
alt="Background Image"
class="mailing-list__image"
/>
<i>Sign up with our volunteer mailing list to stay updated on any future volunteer opportunities!</i>
<div class="new-signup-form">
<form id="volunteer-signup-form">
<label for="fullName">Full Name <span style="color: red;">*</span></label>
<input type="text" id="fullName" name="fullName" required>
<label for="cmail">Cmail (@cmail.carleton.ca) <span style="color: red;">*</span></label>
<input type="email" id="cmail" name="cmail" pattern=".*@cmail\.carleton\.ca$" title="Please enter a valid cmail.carleton.ca address" required>
<label>How would you be interested in volunteering? <span style="color: red;">*</span></label>
<div>
<input type="checkbox" id="logistics" name="volunteerInterest" value="Event & Service Logistics (Zero Commitment)">
<label for="logistics">Event & Service Logistics (Zero Commitment)</label>
</div>
<div>
<input type="checkbox" id="graphicDesign" name="volunteerInterest" value="Graphic & Poster Design (Zero Commitment)">
<label for="graphicDesign">Graphic & Poster Design (Zero Commitment)</label>
</div>
<div>
<input type="checkbox" id="dayOfEvents" name="volunteerInterest" value="Day Of Events Volunteer (On-Call)">
<label for="dayOfEvents">"Day Of" Events Volunteer (On-Call)</label>
</div>
<div>
<input type="checkbox" id="photography" name="volunteerInterest" value="Photography (On-Call, Must Own Camera+)">
<label for="photography">Photography (On-Call, Must Own Camera+)</label>
</div>
<div>
<input type="checkbox" id="talkPresenter" name="volunteerInterest" value="Talk / Workshop Presenter (On-Call)">
<label for="talkPresenter">Talk / Workshop Presenter (On-Call)</label>
</div>
<div>
<input type="checkbox" id="loungeVolunteer" name="volunteerInterest" value="Lounge Volunteer (Recurring Commitment)">
<label for="loungeVolunteer">Lounge Volunteer (Recurring Commitment)</label>
</div>
<div>
<input type="checkbox" id="resourceCreation" name="volunteerInterest" value="Resource Creation (Coming Soon)">
<label for="resourceCreation">Resource Creation (Coming Soon)</label>
</div>
<div>
<input type="checkbox" id="development" name="volunteerInterest" value="Development (Coming Soon)">
<label for="development">Development (Coming Soon)</label>
</div>
<div>
<input type="checkbox" id="other" name="volunteerInterest" value="Other">
<label for="other">Other:</label>
<input type="text" id="otherText" name="otherText" disabled>
</div>
<button type="submit">Subscribe</button>
<div id="formMessage"></div>
</form>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const otherCheckbox = document.getElementById('other');
const otherTextInput = document.getElementById('otherText');
otherCheckbox.addEventListener('change', () => {
otherTextInput.disabled = !otherCheckbox.checked;
if (!otherCheckbox.checked) {
otherTextInput.value = '';
}
});
const form = document.getElementById('volunteer-signup-form');
const formMessage = document.getElementById('formMessage');
form.addEventListener('submit', async (event) => {
event.preventDefault();
// Validate that at least one volunteer interest is selected
const volunteerInterests = form.querySelectorAll('input[name="volunteerInterest"]:checked');
if (volunteerInterests.length === 0) {
formMessage.textContent = 'Please select at least one volunteer interest.';
formMessage.style.color = '#dc3545';
return;
}
const formData = new FormData(form);
const data = {};
formData.forEach((value, key) => {
if (key === 'volunteerInterest') {
if (!data[key]) {
data[key] = [];
}
data[key].push(value);
} else {
data[key] = value;
}
});
if (data.volunteerInterest && data.volunteerInterest.includes('Other')) {
data.volunteerInterest = data.volunteerInterest.filter(item => item !== 'Other');
if (data.otherText) {
data.volunteerInterest.push(`Other: ${data.otherText}`);
}
}
delete data.otherText;
});
});
</script>
<style>
.new-signup-form {
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
background-color: #fff;
}
.new-signup-form label {
display: block;
margin-bottom: 4px;
font-weight: bold;
}
.new-signup-form input[type="text"],
.new-signup-form input[type="email"] {
width: calc(100% - 20px);
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 4px;
}
.new-signup-form input[type="checkbox"] {
margin-right: 10px;
}
.new-signup-form div {
margin-bottom: 5px;
}
.new-signup-form button {
background-color: #dc3545;
color: white;
padding: 12px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
margin-top: 20px;
}
.new-signup-form button:hover {
background-color: #c82333;
}
#formMessage {
margin-top: 15px;
text-align: center;
font-weight: bold;
}
</style>
</div>
{{ end }}