Tipp-Speichern absichern: DB-Fehler abfangen, Fehlerseite statt weisser 500-Antwort, Doppel-Submit bremsen
This commit is contained in:
parent
7ec9f6695d
commit
2ae15e0856
9 changed files with 210 additions and 7 deletions
|
|
@ -56,4 +56,25 @@ $teamLogo = function ($name) {
|
|||
.tipp-form .hint { color: #666; font-size: 0.8em; }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Doppel-Submit bremsen: Nach dem Absenden bleibt der Button gesperrt,
|
||||
// bis die Antwort da ist.
|
||||
(function () {
|
||||
const form = document.querySelector('form.tipp-form');
|
||||
if (!form) return;
|
||||
const submit = form.querySelector('button[type="submit"]');
|
||||
form.addEventListener('submit', function (event) {
|
||||
if (form.dataset.submitting === '1') {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
form.dataset.submitting = '1';
|
||||
if (submit) {
|
||||
submit.disabled = true;
|
||||
submit.textContent = 'Speichern…';
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php require __DIR__ . '/../partials/footer.php'; ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue