prevent forms from double-submitting

pull/142/head
Aevann 2023-03-21 20:56:05 +02:00
parent 14f20283c1
commit 9a5488d8cb
1 changed files with 10 additions and 0 deletions

View File

@ -616,3 +616,13 @@ if (width <= 768) {
}
});
}
document.getElementsByTagName('form').forEach(form => {
form.addEventListener('submit', (e) => {
if (form.classList.contains('is-submitting')) {
e.preventDefault();
}
form.classList.add('is-submitting');
});
});