From d0ebf6baabaa18bdf090021e08668de681ee04d7 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 4 Jan 2024 15:05:41 -0600 Subject: [PATCH] front-end of mt-form nearly ready for publishing Front end of mt-form is basically ready. There could be some tweaks to wording here and there, but it's mostly done. Will need to adjust how it sends the form when we actually send it on, but for now, it's ready. --- content/mt-form.md | 6 ++--- layouts/shortcodes/mt-form.html | 40 ++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/content/mt-form.md b/content/mt-form.md index 65c03fc..dc3f76e 100644 --- a/content/mt-form.md +++ b/content/mt-form.md @@ -38,11 +38,11 @@ With the same common sense precautions that you would take traveling anywhere, o It’s easy to forget just how big Mexico is, and how far our location is from the warning areas! If you visit us, in most cases your flight will arrive directly to Huatulco (HUX), or by means of the Mexico City airport to Puerto Escondido (PXM), these being our nearest international airports. There we meet you at the airport and drive you here. You’re not within a thousand miles of a border town or hundreds of miles from a city with a warning. We also begin your stay here with an orientation, which includes safety tips to avoid any danger that might present itself. We live here and we raise our children here. You can trust our record of many years of safety for visitors and students. -## MASH (Making Adventures Serving Happily) 1-2 Day Local Trip - TBD -Formerly known as the SPLASH trip, this trip will be within 2 hours of the TFC office in Phillipsburg, KS and will be a 2 day trip where you can get a taste for a longer mission trip. If you don’t feel ready to go on a longer trip, this is the trip for you! You will still have the opportunity to serve and grow in your faith in Jesus. There is a special form for the MASH trip! +## 1-2 Day Local Trip - TBD +Formerly known as the SPLASH trip, this trip will be within 2 hours of the TFC office in Phillipsburg, KS and will be a 2 day trip where you can get a taste for a longer mission trip. If you don’t feel ready to go on a longer trip, or have scheduling conflicts with the other trips, this is the trip for you! You will still have the opportunity to serve and grow in your faith in Jesus. Click the button below to sign up for this trip! {{< button href="/mash-form">}} -MASH +Local Trip {{< /button >}} ## Mission Trip Agreement diff --git a/layouts/shortcodes/mt-form.html b/layouts/shortcodes/mt-form.html index 37f8b99..0810a7b 100644 --- a/layouts/shortcodes/mt-form.html +++ b/layouts/shortcodes/mt-form.html @@ -12,22 +12,36 @@ const age = calculate_age(birthdate); data.append("age", age); - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { - // Logic directing where to send the user after form submission based on results. - // This is how to send them. window.location.href = '/thankyou/'; + let base = "http://localhost:4242/mt-form"; - var payment = document.getElementById('registration').value; - window.location.href = '/mt-health-form?mtregistration=' + payment; - // Need to eventually get the user here: https://secure.myvanco.com/L-Z772/campaign/C-13DM3 + fetch(base, { + method: "POST", + body: data + }).then((res) => { + console.log(res); + if (res.ok) { + //var payment = document.getElementById('registration').value; + //window.location.href = '/mt-health-form?mtregistration=' + payment; + console.log(res); } - }; + }); + + /* var xhr = new XMLHttpRequest(); + * xhr.onreadystatechange = function() { + * if (this.readyState == 4 && this.status == 200) { + * // Logic directing where to send the user after form submission based on results. + * // This is how to send them. window.location.href = '/thankyou/'; + + * var payment = document.getElementById('registration').value; + * window.location.href = '/mt-health-form?mtregistration=' + payment; + * // Need to eventually get the user here: https://secure.myvanco.com/L-Z772/campaign/C-13DM3 + * } + * }; */ /* xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-application"); */ - xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-application"); - xhr.send(data); - console.log(data); - console.log("Hallo!"); + /* xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-application"); + * xhr.send(data); + * console.log(data); + * console.log("Hallo!"); */ /* return false; */ }