How to limit value or length of number field?

How to limit value or length of number field?

altrackaaltracka Posts: 9Questions: 6Answers: 0
edited February 2023 in Free community support

I would like to limit a number field to a reasonably small value. I would prefer to limit the value to 1000, but would also be happy to limit the length to 3. maxlength works if the type is text, but it has no effect if the type is number- it lets me type any length of input, for example 9999999999.

var editor = new $.fn.dataTable.Editor({
      table: containerId,
      display: 'bootstrap',
      fields: [
            { label: 'good', attr: { maxlength: 3 } },
            { label: 'bad', attr: { type: "number", maxlength: 3 } },
      ],
});

Answers

Sign In or Register to comment.