How to check if a text input is number

I recently had a problem validating a number field to prevent the user from sending text instead of a number. So I found this solution that is working for me so far.

image

As any number is divisible by 1, the result will always be true, but when adding a letter the result will be false.

1 Like

You can change the Keyboard Type in Input Component Details to Numerical.
Screenshot 2024-04-30 at 3.44.17 PM


Want to hire a Certified Thunkable Expert? Whoocoder | Thunkable Expert | Hire Now On Fiver!!

But on android, there is an option to paste any text into the field. Therefore, there is no point in the field being defined as numeric.

Strings won’t get Pasted, try it.


Want to hire a Certified Thunkable Expert? Whoocoder | Thunkable Expert | Hire Now On Fiver!!

Or if you want, here’s a Post to do that:


Want to hire a Certified Thunkable Expert? Whoocoder | Thunkable Expert | Hire Now On Fiver!!

I took this test. I copied a string from a notepad and pasted it into the field in the live test and it actually pasted normally. I don’t know if it could be a bug in the thunkable, but in the test, it pasted the string.

But with just these blocks, number validation is perfect.

image

1 Like

We Can do it this way too


Want to hire a Certified Thunkable Expert? Whoocoder | Thunkable Expert | Hire Now On Fiver!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.