document.addEventListener('DOMContentLoaded', function() {
const sendFormLink = document.querySelector('a[href="#sendmyform"]');
const form = document.getElementById('sendmyform');
const successMessage = document.getElementById('success-message');
if (sendFormLink && form) {
sendFormLink.addEventListener('click', function(e) {
e.preventDefault();
const formData = new FormData(form);
fetch(form.action, {
method: form.method,
body: formData,
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.text();
})
.then(data => {
form.style.display = 'none';
successMessage.style.display = 'block';
})
.catch(error => {
console