Restrict alphabets in text field

Hi @sdirix,

I need to add a feature that restrict alphabets in the textfield I mean only digits(0-9) are allowed but not any other character I tried in two ways by giving this pattern “[1]{10}$” and the second way I implemented is changing type to integer. In the first case, restricting characters failed. In the second case, characters are restricted but arrows (to increase and decrease number) are displayed How to acheive this?
Screenshot (22)

  1. 0-9 ↩︎

Hi @Varuu,

The arrow comes in because we are using an input for integers there. However, as you already noted, a string field which whitelists certain characters is definitely a better UX.

We don’t have any out of the box support for restricting user input. You will need to implement a custom renderer and add the behavior yourself. This should be rather straightforward. I would like to recommend copying and adapting the MaterialTextControl to your needs.

Thanks for the reply @sdirix. I have used custom Renderer and acheived my requirement.