This commit is contained in:
2020-04-30 15:31:36 +02:00
parent 67b538c8b5
commit aec07b9438
2 changed files with 22 additions and 17 deletions

View File

@@ -1,12 +1,14 @@
document.addEventListener("turbolinks:load", function () {
var form = document.getElementById('contact-us-form');
form.addEventListener('submit', function (e) {
document.getElementById("contact-us-form-submit-button").classList.add('is-hidden');
document.getElementById("contact-us-form-loading-state").classList.remove('is-hidden');
});
var form = document.getElementById('contact-us-form');
if (!form) { return; }
form.addEventListener('tinyforms:submitted', function(e) {
form.classList.add('is-hidden');
document.getElementById("contact-us-form-success-message").classList.remove('is-hidden');
})
form.addEventListener('submit', function (e) {
document.getElementById("contact-us-form-submit-button").classList.add('is-hidden');
document.getElementById("contact-us-form-loading-state").classList.remove('is-hidden');
});
form.addEventListener('tinyforms:submitted', function(e) {
form.classList.add('is-hidden');
document.getElementById("contact-us-form-success-message").classList.remove('is-hidden');
});
});