A mandatory case log field is now considered as 'filled' if it contains a previous entry

SVN:trunk[1468]
This commit is contained in:
Denis Flaven
2011-08-18 10:45:41 +00:00
parent 58e61c9d6b
commit 2f1803b3b6

View File

@@ -295,6 +295,35 @@ function ValidatePasswordField(id, sFormId)
return true;
}
//Special validation function for case log fields, taking into account the history
// to determine if the field is empty or not
function ValidateCaseLogField(sFieldId, bMandatory, sFormId)
{
bValid = true;
if ($('#'+sFieldId).attr('disabled'))
{
bValid = true; // disabled fields are not checked
}
else if (!bMandatory)
{
bValid = true;
}
else
{
if (bMandatory)
{
var count = $('#'+sFieldId+'_count').val();
if ( (count == 0) && ($('#'+sFieldId).val() == '') )
{
// No previous entry and no content typed
bValid = false;
}
}
}
ReportFieldValidationStatus(sFieldId, sFormId, bValid);
return bValid;
}
// Manage a 'duration' field
function UpdateDuration(iId)
{