Browse Source

NEW field required on mandatory fields

lvessiller 3 năm trước cách đây
mục cha
commit
9f8a9db39e
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      htdocs/core/lib/functions.lib.php

+ 3 - 0
htdocs/core/lib/functions.lib.php

@@ -8990,6 +8990,9 @@ function printCommonFooter($zone = 'private')
 								print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
 								print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'-1\']").prop(\'value\', \'\');'."\n";
 								print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'0\']").prop(\'value\', \'\');'."\n";
+
+								// 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";
 							}
 						}
 					}