Validator not working on type numeric

Tags: #<Tag:0x00007f8b2861f188>

Hi,
On my handson table I’ve a column which is of type ‘numeric’ and i’ve put a validator on it to check length. The same condition is working perfectly fine on type ‘text’ but not on numeric. Can you tell me why. The validator code is as follows:
{
data: ‘sl_no’,
type: ‘numeric’,
validator: function (value, callback) {
if(value.length >= 1 && value.length <= 3) {
callback(true);
} else {
alert(‘Length should be 1-3.’);
callback(false);
}
}
},

Hey @bhavrao8

seem to work fine https://jsfiddle.net/dz735eph/
But you can check the quotes cause I needed to change them.

1 Like