forked from rDrama/rDrama
prevent forms from double-submitting
parent
14f20283c1
commit
9a5488d8cb
|
@ -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');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue