Course Enrollment Form
function submitForm() {
const scriptURL = 'Yhttps://script.google.com/macros/s/AKfycbxg_p9fno2EyXNLItAhIfS_cefAytgkMf95P4qGqcoLQmEjDZ7W-bBhDsnsY3IcMvtH/exec'; // Replace with your Apps Script deployment URL
const form = document.getElementById('enrollmentForm');
const formData = new FormData(form);
const data = {};
formData.forEach((value, key) => (data[key] = value));
fetch(scriptURL, {
method: 'POST',
body: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' },
})
.then(response => alert('Form submitted successfully!'))
.catch(error => alert('Error: ' + error.message));
}