From 1a10894e886c957cdeb483609de7adb26c8c0663 Mon Sep 17 00:00:00 2001 From: pascal Date: Sat, 30 Sep 2023 17:51:14 +0200 Subject: [PATCH] FIX #25127 --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19862b2b4f2..a7554ed27e6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9999,6 +9999,8 @@ function printCommonFooter($zone = 'private') // Add 'field required' class on closest td for all input elements : input, textarea and select print 'jQuery(":input[name=\'' . $paramkey . '\']").closest("tr").find("td:first").addClass("fieldrequired");' . "\n"; } + // If we submit the cancel button we remove the required attributes + print 'jQuery("input[name=\'cancel\']").click(function() {jQuery("input, textarea, select").each(function(){this.removeAttribute(\'required\');});});'."\n"; } } }