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"; } } }