How to make text input shows numbers only?

Hi, thanks for your reply, I mean when I press the button, the “text input” inputs numbers only.
For example if I press “C” , “2” and “1”, the text input result should be “21” only.