diff --git a/campusResource.html b/campusResource.html
index b2efdf8..33d21d7 100644
--- a/campusResource.html
+++ b/campusResource.html
@@ -1,192 +1,204 @@
-
-
- Resource Form
-
-
-
-
-
+
+
+ Resource Form
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+ // Closes form upon clicking outside of box
+ window.onclick = function(event) {
+ const modal = document.getElementById("formModal");
+ if (event.target === modal) {
+ modal.style.display = "none";
+ }
+ }
+
+ // When form is submitted, stores the results to HTML text in a ResourceDiv, which is then added to the resource list
+ document.getElementById("resourceForm").addEventListener("submit", function(e) {
+ e.preventDefault(); // Stop page refresh
+
+ const name = this.resourceName.value;
+ const location = this.location.value;
+ const description = this.description.value;
+ const availability = this.availability.value;
+
+ const resourceList = document.getElementById("resourceList");
+ const resourceDiv = document.createElement("div");
+ resourceDiv.className = "resourceItem";
+
+ resourceDiv.innerHTML = `
+ ${name}
+ ${location}
+ ${description}
+ Status: ${availability}
+
+ `;
+
+ resourceList.appendChild(resourceDiv);
+
+ this.reset();
+ closeForm();
+ });
+
+
+
+
\ No newline at end of file