From 146c694c6f583a831d896f223dfd4ae0b623084e Mon Sep 17 00:00:00 2001 From: HWFord <54360213+HWFord@users.noreply.github.com> Date: Fri, 14 Nov 2025 10:34:43 +0100 Subject: [PATCH] issue #2437 update standard pages change how required inputs are handled change js to display error message for inputs only with data-required for register handle mandatory or not email update success message css --- themes/standard_pages/js/standard_pages.js | 21 ++++++++++++------- .../template/identification.tpl | 4 ++-- themes/standard_pages/template/password.tpl | 2 +- themes/standard_pages/template/register.tpl | 10 ++++----- themes/standard_pages/theme.css | 9 ++++++++ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/themes/standard_pages/js/standard_pages.js b/themes/standard_pages/js/standard_pages.js index 4b833e520..57522bc14 100644 --- a/themes/standard_pages/js/standard_pages.js +++ b/themes/standard_pages/js/standard_pages.js @@ -19,10 +19,16 @@ jQuery( document ).ready(function() { jQuery("#selected-language").textContent = selected_language; //Override empty input message - jQuery("form").on("submit", function (e) { - let isValid = true; - - jQuery(".column-flex").each(function () { + jQuery("form").on("submit", function (e) { + let isValid = true; + + jQuery(".column-flex").each(function (i) { + // Because we overid the default browser error message + // we need to distinguish which fields are now required + // To do this we use data-required="true" on the input + let input = $(this).find("input"); + if($(input).data("required") == true) + { let input = jQuery(this).find("input"); let errorMessage = jQuery(this).find(".error-message"); if (!input.val().trim()) { @@ -35,11 +41,12 @@ jQuery( document ).ready(function() { input[0].setCustomValidity(""); errorMessage.hide(); } - }); - - return isValid; + } }); + return isValid; + }); + // Hide error message and reset validation on input jQuery(".column-flex input").on("input", function () { let errorMessage = jQuery(this).closest(".column-flex").find(".error-message"); diff --git a/themes/standard_pages/template/identification.tpl b/themes/standard_pages/template/identification.tpl index 8b3d7ac02..4c7c60c74 100644 --- a/themes/standard_pages/template/identification.tpl +++ b/themes/standard_pages/template/identification.tpl @@ -45,8 +45,8 @@