Implementation of bulk modify and bulk apply stimulus... to be tested !

SVN:trunk[1145]
This commit is contained in:
Denis Flaven
2011-03-23 16:22:35 +00:00
parent 9b50124513
commit bec8b57fe1
21 changed files with 1458 additions and 226 deletions

View File

@@ -174,26 +174,33 @@ function ReportFieldValidationStatus(sFieldId, sFormId, bValid)
function ValidateField(sFieldId, sPattern, bMandatory, sFormId, nullValue)
{
var bValid = true;
var currentVal = $('#'+sFieldId).val();
if ($('#'+sFieldId).attr('disabled'))
{
bValid = true; // disabled fields are not checked
}
else
{
var currentVal = $('#'+sFieldId).val();
if (currentVal == '$$NULL$$') // Convention to indicate a non-valid value since it may have to be passed as text
{
bValid = false;
}
else if (bMandatory && (currentVal == nullValue))
{
bValid = false;
}
else if (currentVal == nullValue)
{
// An empty field is Ok...
bValid = true;
}
else if (sPattern != '')
{
re = new RegExp(sPattern);
//console.log('Validating field: '+sFieldId + ' current value: '+currentVal + ' pattern: '+sPattern );
bValid = re.test(currentVal);
if (currentVal == '$$NULL$$') // Convention to indicate a non-valid value since it may have to be passed as text
{
bValid = false;
}
else if (bMandatory && (currentVal == nullValue))
{
bValid = false;
}
else if (currentVal == nullValue)
{
// An empty field is Ok...
bValid = true;
}
else if (sPattern != '')
{
re = new RegExp(sPattern);
//console.log('Validating field: '+sFieldId + ' current value: '+currentVal + ' pattern: '+sPattern );
bValid = re.test(currentVal);
}
}
ReportFieldValidationStatus(sFieldId, sFormId, bValid);
//console.log('Form: '+sFormId+' Validating field: '+sFieldId + ' current value: '+currentVal+' pattern: '+sPattern+' result: '+bValid );