Set Data Table Column with Numeric Input Only


Is there a way to create validation for numeric only input on one of Data Table column? We can easily set this on Single-line Text fileds and set the Type, but no such control on Data Table field.


Hello @AdityaGiriHertanto,

You can change the input type of the column to Number, so only a numeric value can be entered.


Hi @mnikitina,

Tried the number type but this also format the field as number, means input will be treated as number with digit separator not free text.

My input will be 15 digit numeric with 0 as first digit. Is it possible to configure it that way?


Hello @AdityaGiriHertanto,

One option is adding column validation that checks if the input value matches regex expression:

fd.control('DataTable1').addColumnValidator('Column1', {
    error: 'Invalid value',
    validate: function(value) {
      var regex_pattern =/0[0-9]{14}/ ;
      var check = new RegExp(regex_pattern);
      var isValid = check.test(value);

      return isValid;

If you consider paid support, we can add a masked input column type to the DataTable. Please email us at [email protected] to know more.