Replies: 1 comment 6 replies
-
please fix the message |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im having some problems and dont what to add for my form to send properly after adding the "enctype="multipart/form-data"" into my form tag. I know I'm suppose to add some sort of script in to my existing script, but what and where do I add it? Please help to show me what to add and where, thanks! This is ALL my scripts for my form. More info... my form was sending before the Attachment was added.
Scripts -
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js"> </script> <script> let dogCount = 1; // Tracks the number of dogs const maxDogs = 4; // Maximum number of dogs allowed // Add Dog Button Functionality document.getElementById('addDogButton').addEventListener('click', () => { if (dogCount < maxDogs) { dogCount++; const dogDetailsContainer = document.getElementById('dogDetailsContainer'); const newDogSection = `Reserve Your Spot – $15 Deposit
<script> // Initialize the slider background on page load function updateSliderBackground(slider) { const value = (slider.value - slider.min) / (slider.max - slider.min) * 100; slider.style.background = `linear-gradient(to right, #5BC0DE ${value}%, #D3D3D3 ${value}%)`; } function updateDogCountLabel(value) { document.querySelectorAll('.slider-labels span').forEach(el => el.style.fontWeight = 'normal'); document.getElementById(`dogLabel${value}`).style.fontWeight = 'bold'; } function updateFrequencyLabel(value) { document.querySelectorAll('.slider-labels span').forEach(el => el.style.fontWeight = 'normal'); document.getElementById(`freqLabel${value}`).style.fontWeight = 'bold'; } function calculatePrice() { const dogCount = parseInt(document.getElementById('dogCountSlider').value); const frequencyValue = parseInt(document.getElementById('frequencySlider').value); const frequencies = { 1: 'twice', 2: 'weekly', 3: 'biweekly', 4: 'monthly' }; const prices = { 1: { twice: 16, weekly: 20, biweekly: 30, monthly: 70 }, 2: { twice: 20, weekly: 24, biweekly: 34, monthly: 80 }, 3: { twice: 24, weekly: 28, biweekly: 38, monthly: 90 }, 4: { twice: 28, weekly: 32, biweekly: 42, monthly: 100 }, }; const frequency = frequencies[frequencyValue]; let totalPrice = prices[dogCount][frequency]; document.getElementById('totalPrice').innerText = totalPrice; } function showPriceAndForm() { calculatePrice(); document.getElementById('priceContainer').style.display = 'block'; document.getElementById('signupFormContainer').style.display = 'block'; } // Initialize slider backgrounds on page load document.querySelectorAll('input[type="range"]').forEach(slider => { updateSliderBackground(slider); }); </script> <script> document.getElementById('contact-form').addEventListener('submit', function(event) { event.preventDefault(); // Prevent default form submission behavior // Hide the button and show the loading message document.getElementById('reserveButton').style.display = 'none'; document.getElementById('loadingMessage').style.display = 'block'; // Your specific service and template IDs const serviceID = 'service_dum6gqe'; // Replace with your actual EmailJS service ID const templateID = 'template_vyogkou'; // Replace with your actual EmailJS template ID emailjs.sendForm(serviceID, templateID, this) .then(function(response) { console.log('SUCCESS!', response.status, response.text); // Redirect to Square payment link after successful submission window.location.href = 'https://square.link/u/njqWcF4m'; // Replace with your actual Square link }, function(error) { console.error('FAILED...', error); alert('FAILED... Please try again later.'); // Revert to show the original button if submission fails document.getElementById('reserveButton').style.display = 'block'; document.getElementById('loadingMessage').style.display = 'none'; }); }); </script>Beta Was this translation helpful? Give feedback.
All reactions