Bug #54752

NumberRangeValidator fails

Added by Nikos Poaros over 1 year ago. Updated 10 months ago.

Status:Closed Start date:2014-01-05
Priority:Must have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-

Description

Small error in Shared/Validation/NumberRangeValidator causes it to fail

This will trigger an error if value is a number as isNaN returns false for a number:

isValid: function(value) {
if ((typeof(value) === 'number' || typeof(value) === 'string') && value !== '' && !isNaN(value)) {
this.addError('A valid number is expected !.');
return;
}

So a simple change, removing the ! sorts it out:

isValid: function(value) {
if ((typeof(value) === 'number' || typeof(value) === 'string') && value !== '' && isNaN(value)) {
this.addError('A valid number is expected !.');
return;
}

History

#1 Updated by Jonas Renggli 10 months ago

  • Status changed from New to Closed

Also available in: Atom PDF