mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
A mandatory case log field is now considered as 'filled' if it contains a previous entry
SVN:trunk[1468]
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user