diff --git a/_site/assets/js/guestbook.js b/_site/assets/js/guestbook.js
index 89d77484..a8617949 100644
--- a/_site/assets/js/guestbook.js
+++ b/_site/assets/js/guestbook.js
@@ -1,5 +1,3 @@
-console.log("Guestbook script successfully loaded");
-
// Import Firebase
import { initializeApp } from 'https://www.gstatic.com/firebasejs/10.12.0/firebase-app.js'
import { getDatabase, ref, push, onValue, update } from 'https://www.gstatic.com/firebasejs/10.12.0/firebase-database.js'
@@ -29,4 +27,17 @@ let messageObj = {
message: '',
timestamp: '',
replies: [],
+};
+
+formEl.addEventListener('submit', (e) => {
+ e.preventDefault();
+ clearInputEl();
+ console.log('Form submitted');
+});
+
+const clearInputEl = () => {
+ nameInputEl.value = '';
+ emailInputEl.value = '';
+ websiteInputEl.value = '';
+ msgInputEl.value = '';
};
\ No newline at end of file
diff --git a/_site/feed.xml b/_site/feed.xml
index 3d6258ed..9ebad38c 100644
--- a/_site/feed.xml
+++ b/_site/feed.xml
@@ -4,7 +4,7 @@
Leilukin's personal website.
- 2024-05-19T06:23:25Z
+ 2024-05-19T06:29:00Z
https://leilukin.neocities.org
Leilukin
diff --git a/src/assets/js/guestbook.js b/src/assets/js/guestbook.js
index 89d77484..a8617949 100644
--- a/src/assets/js/guestbook.js
+++ b/src/assets/js/guestbook.js
@@ -1,5 +1,3 @@
-console.log("Guestbook script successfully loaded");
-
// Import Firebase
import { initializeApp } from 'https://www.gstatic.com/firebasejs/10.12.0/firebase-app.js'
import { getDatabase, ref, push, onValue, update } from 'https://www.gstatic.com/firebasejs/10.12.0/firebase-database.js'
@@ -29,4 +27,17 @@ let messageObj = {
message: '',
timestamp: '',
replies: [],
+};
+
+formEl.addEventListener('submit', (e) => {
+ e.preventDefault();
+ clearInputEl();
+ console.log('Form submitted');
+});
+
+const clearInputEl = () => {
+ nameInputEl.value = '';
+ emailInputEl.value = '';
+ websiteInputEl.value = '';
+ msgInputEl.value = '';
};
\ No newline at end of file