Fix integer validation in dashlet forms

Mandatory integer fields were valid even when empty. (Thanks @Hipska for the fix!)
This commit is contained in:
Thomas Casteleyn
2018-10-19 15:06:56 +02:00
committed by Molkobain
parent ada56da63e
commit 30c622052e

View File

@@ -574,10 +574,12 @@ function ValidateInteger(sFieldId, bMandatory, sFormId, iMin, iMax, sExplainForm
{
bValid = false;
}
re = new RegExp('^$|^-?[0-9]+$');
bValid = re.test(currentVal);
else
{
re = new RegExp('^$|^-?[0-9]+$');
bValid = re.test(currentVal);
}
if (bValid && (currentVal != ''))
{
// It is a valid number, let's check the boundaries