mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Fix integer validation in dashlet forms
Mandatory integer fields were valid even when empty. (Thanks @Hipska for the fix!)
This commit is contained in:
committed by
Molkobain
parent
ada56da63e
commit
30c622052e
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user