From bd3333b8a37bbf3184afbd353aef636053614206 Mon Sep 17 00:00:00 2001
From: Alvin <524715@vistacollege.nl>
Date: Wed, 4 Jun 2025 12:28:07 +0200
Subject: [PATCH] Enhance contact form in index.html by adding required fields
for name, email, phone, and message. Update form submission handling in
script.js to include success message display and improved error handling.
Refactor button functionality for better user experience during form
submission.
---
index.html | 138 ++++++++++++++++++++++++++++++++++++++++++++++++---
js/script.js | 68 +++++++++++++++++++------
2 files changed, 184 insertions(+), 22 deletions(-)
diff --git a/index.html b/index.html
index 1f471bb..7686a54 100644
--- a/index.html
+++ b/index.html
@@ -170,18 +170,22 @@
Neem Contact Op
-
+
Bedankt voor je interesse! We nemen zo snel mogelijk contact met je op.
diff --git a/js/script.js b/js/script.js
index b5f748f..1a816a9 100644
--- a/js/script.js
+++ b/js/script.js
@@ -15,12 +15,14 @@ document.addEventListener('DOMContentLoaded', () => {
// Get Started button functionality
const getStartedButtons = document.querySelectorAll('.btn-primary');
getStartedButtons.forEach(button => {
- button.addEventListener('click', () => {
+ button.addEventListener('click', (e) => {
+ // Prevent modal from opening if this is the form submit button
+ if (button.type === 'submit' || button.closest('form')) return;
// Create and show modal
const modal = document.createElement('div');
modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 fade-in';
modal.innerHTML = `
-