Tipp-Speichern absichern: DB-Fehler abfangen, Fehlerseite statt weisser 500-Antwort, Doppel-Submit bremsen

This commit is contained in:
torsten 2026-10-31 11:40:56 +01:00
parent 7ec9f6695d
commit 2ae15e0856
9 changed files with 210 additions and 7 deletions

View file

@ -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'; ?>