updates making all forms work in production

This commit is contained in:
Chris Cochrun 2023-01-04 16:47:03 -06:00
parent 02f73ff7d1
commit 5e770a4ef5
3 changed files with 21 additions and 3 deletions

View file

@ -7,7 +7,13 @@
const data = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://n8n.tfcconnection.org/webhook-test/mt-church-form");
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Logic directing where to send the user after form submission based on results.
window.location.href = '/thankyou/';
};
};
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-church-form");
xhr.send(data);
console.log(data);
console.log("Hallo!");

View file

@ -7,7 +7,13 @@
const data = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://n8n.tfcconnection.org/webhook-test/mt-parent-form");
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Logic directing where to send the user after form submission based on results.
window.location.href = '/thankyou/';
};
};
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-parent-form");
xhr.send(data);
console.log(data);
console.log("Hallo!");

View file

@ -7,7 +7,13 @@
const data = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://n8n.tfcconnection.org/webhook-test/mt-teacher-form");
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Logic directing where to send the user after form submission based on results.
window.location.href = '/thankyou/';
};
};
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-teacher-form");
xhr.send(data);
console.log(data);
console.log("Hallo!");