How to prevent users from entering '0' infront of any number?

I’m currently making an app where people will be updating data to firebase. In a field they are supposed to enter numbers from 1 to 30. The problem is that some of them use zero before a number (like 01, 02,…). I want to prevent people from doing that & show an error message. I know how to set an error message & make them enter values from 1 to 30 only. But I dont know how to do the zero thing, coz 01 is also considered as ‘1’. Any idea on what to do ?

if
segment text
start - 1
length - 1

is = 0

then show error message


Or you can Block it this way -
Let the User Enter the Value Any Way they want - 01 or 1
But while Storing the Value Remove 0

2 Likes

bild

5 Likes

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