From b0dfc4e3b5aab58fce956aff22e430de792352fa Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 28 Dec 2022 10:02:06 -0600 Subject: [PATCH] updating the mission trip forms submission code --- layouts/shortcodes/mt-form.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/mt-form.html b/layouts/shortcodes/mt-form.html index b3d5349..5f9e933 100644 --- a/layouts/shortcodes/mt-form.html +++ b/layouts/shortcodes/mt-form.html @@ -12,11 +12,16 @@ data.append("age", age); var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + window.location.href = '/thankyou/'; + } + }; xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-application"); xhr.send(data); console.log(data); console.log("Hallo!"); - return false; + /* return false; */ } function calculate_age(dob) {