Reputation: 93
I have a 5 textboxes that can input only numbers. I used /^[1-9][0-9]+$/
, but what I need is if single digit is zero allow it.
Just like the picture above, I have 5 textboxes if 1 of the textbox is already equal the quantity the other textbox should allow a zero value. It can't be greater or lower than in quantity.
Upvotes: 0
Views: 1271
Reputation: 39522
Your best bet is:
/^\d+$/
Which will allow only a number of one or more digits.
Breakdown
/
start of regex
^
matches beginning of string
\d
matches any digit
+
modifies the above to match one or more
$
matches the end of line
/
ends the regex
Upvotes: 4