mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-08 18:48:22 +01:00
NEW The setup for mandatory field can be done on combo list too.
This commit is contained in:
@@ -7872,7 +7872,10 @@ function printCommonFooter($zone = 'private')
|
||||
// Add property 'required' on input
|
||||
print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
||||
print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
||||
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
||||
print '// required on a select works only if key is "", so we add the required attributes but also we reset the key -1 or 0 to an empty string'."\n";
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user