-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.js
20 lines (17 loc) · 933 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const nameInput = document.getElementById('name');
const locationInput = document.getElementById('location');
const spacejamInput = document.getElementById('spacejam');
const emailInput = document.getElementById('email');
const applyLink = document.getElementById('apply');
const getLink = () => {
const name = encodeURIComponent(nameInput.value);
const location = encodeURIComponent(locationInput.value);
const spacejam = encodeURIComponent(spacejamInput.value);
const email = encodeURIComponent(emailInput.value);
return `https://docs.google.com/forms/d/e/1FAIpQLSdDoCWLhEOt_hVR04474f2xKHJe0jrEuoO87Ra5BQlXtXLyGQ/viewform?usp=pp_url&entry.1160134771=${name}&entry.1912821810=${email}&entry.2117272494=${location}&entry.42582944=${spacejam}`;
};
[nameInput, locationInput, spacejamInput, emailInput].forEach(input => {
input.addEventListener('change', () => {
applyLink.setAttribute('href', getLink());
});
});