From d0c82488e0103d9f2e282033c660c400aa91eae0 Mon Sep 17 00:00:00 2001 From: vgreb Date: Mon, 25 May 2026 21:21:46 +0200 Subject: [PATCH] =?UTF-8?q?Correction(billeterie):=20affichage=20de=20l'?= =?UTF-8?q?=C3=A9tape=20contenant=20une=20errueur=20apr=C3=A8s=20validatio?= =?UTF-8?q?n=20du=20formulaire=20par=20le=20serveur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/js/tickets.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/js/tickets.js b/htdocs/js/tickets.js index ce4e6b087..9ed06e84a 100644 --- a/htdocs/js/tickets.js +++ b/htdocs/js/tickets.js @@ -551,6 +551,17 @@ $(document).ready(function() { cloneTransport(); updateSummary(); + // After a server-side validation failure the page re-renders at step 1, hiding field + // errors that live in step 2 or step 3. Detect those errors and jump to the right step + // so the user can see what needs to be corrected. + if ($('.tickets--errors p').length > 0) { + if ($('#ticket-step-2 .tickets--errors li').length > 0) { + goToStep(2); + } else if ($('#ticket-step-3 .tickets--errors li').length > 0) { + goToStep(3); + } + } + // Handle form submission $('#formulaire').on('submit', function(e) { // Validate final step for payment and billing info