|
@@ -1078,7 +1078,12 @@ abstract class cmdbAbstractObject extends CMDBObject
|
|
$sPattern = addslashes($oAttDef->GetValidationPattern()); //'^([0-9]+)$';
|
|
$sPattern = addslashes($oAttDef->GetValidationPattern()); //'^([0-9]+)$';
|
|
if (!empty($aEventsList))
|
|
if (!empty($aEventsList))
|
|
{
|
|
{
|
|
- $oPage->add_ready_script("$('#$iId').bind('".implode(' ', $aEventsList)."', function(evt, sFormId) { return ValidateField('$iId', '$sPattern', $bMandatory, sFormId) } );"); // Bind to a custom event: validate
|
|
|
|
|
|
+ $sNullValue = $oAttDef->GetNullValue();
|
|
|
|
+ if (!is_numeric($sNullValue))
|
|
|
|
+ {
|
|
|
|
+ $sNullValue = "'$sNullValue'"; // Add quotes to turn this into a JS string if it's not a number
|
|
|
|
+ }
|
|
|
|
+ $oPage->add_ready_script("$('#$iId').bind('".implode(' ', $aEventsList)."', function(evt, sFormId) { return ValidateField('$iId', '$sPattern', $bMandatory, sFormId, $sNullValue) } );"); // Bind to a custom event: validate
|
|
}
|
|
}
|
|
$aDependencies = MetaModel::GetDependentAttributes($sClass, $sAttCode); // List of attributes that depend on the current one
|
|
$aDependencies = MetaModel::GetDependentAttributes($sClass, $sAttCode); // List of attributes that depend on the current one
|
|
if (count($aDependencies) > 0)
|
|
if (count($aDependencies) > 0)
|