custom maximum length of an integer attribute

1
I need quick help. I have one integer attribute and set the custom maximum length to 8. but it is still accepting 10 digits.
asked
1 answers
4

Hi Iqbal,

It seems like the attribute length form field property only applies to String attributes. When defining attributes in the domain model, there is a length property for those that are of type String. Since only String attributes have this property, it only applies to them in forms.

If you want to limit the input of integers to a specific number of digits, you can, from the domain model, add a validation rule to the attribute restricting it to a number of characters. The user will still be able to put in any number of characters, but the form will not submit and they will see the validation error message below the form field. Additionally, you can also use custom validation via a custom save button to accomplish this.

answered