This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
interestform.html
62 lines (53 loc) · 1.98 KB
/
interestform.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
---
layout: default
title: Interest form
permalink: /interestform/
useContainer: true
description: Sign up for RevolutionUC 2023!
---
<div class="container">
<p>RevolutionUC is a student hackathon in which we invite students from across the midwest to partake in a weekend of code, community, and self-improvement. You don’t have to attend the University of Cincinnati and you don’t have to be a computer science major or engineering student. We’re looking for people who share our passion to do awesome things with technology.</p>
</div>
<div class="container">
<form name="interestForm" method="POST" data-netlify="true" data-netlify-recaptcha="true">
<p>
<label> Name: <input required type="text" name="name" /></label>
</p>
<p>
<label> Email: <input required type="email" name="email" /></label>
</p>
<p>
<label> University: <input required type="text" name="university" /></label>
</p>
<p>
<button type="submit">Send</button>
</p>
<div data-netlify-recaptcha="true"></div>
<div class="submit-success"><p>Message sent!🎉</p></div>
<div class="submit-error"><p>Error.</p></div>
</form>
</div>
<script>
const submitSuccess = document.querySelector('.submit-success')
const submitError = document.querySelector('.submit-error')
const handleSubmit = (e) => {
e.preventDefault();
let myForm = document.getElementById("email-notification");
let formData = new FormData(myForm);
fetch("/", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams(formData).toString(),
})
.then(() => { submitSuccess.style.display = 'block'; submitError.style.display = null; })
.catch((error) => { submitError.style.display = 'block'; submitSuccess.style.display = null; });
};
document
.querySelector("form")
.addEventListener("submit", handleSubmit);
</script>
<style>
.submit-success, .submit-error {
display: none;
}
</style>