How to make text input shows numbers only?

Hi, I’m making a calculator and the way to input texts in the “text_input 1” is clicking the buttons, I made 3 buttons which are “C” “0” and “E”. So now when I click the buttons accordingly, the text input box will become “C0E”. But I want numbers only in the text input box. What should I do? Thanks.

Hi

Select the appropriate keyboard type for the field on the Adwanced tab

изображение

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.

Clear. Create the string 0123456789 and check whether it matches. If a character is included in this string, add it to the output string

May I know how to do that? I’m sorry I’m new to Thunkable. Thanks again.

изображение

It shows this when I press “C” button (My “C” button is Button 1)

I noticed that I did something wrong with the blocks you screenshot to me and I redone it. When I press button 1 the text input is cleared and shows “C” instead. But what I want is the “C” and “E” will not append their text into the text input box when their respective button is clicked

Btw this is the blocks and result after i press “C” (regardless what button I pressed before pressing “C”, it shows the same result)


I added this (From “button” “component” get “Text” ≥ 0) and it worked, but thanks for your help too :slight_smile:

1 Like