Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

How to restrict numeric values entered into an Entry field.

$
0
0

I need to restrict the value being typed into an Entry field to values between 0 and 20. However, I don't want highlight it in red if it's outside that range or anything, I want to actually prevent the value from appearing in the field if the user types 30, for example (the 3 would appear since it's valid but if the user then types a 0 it should not be accepted). I have successfully used behaviors to validate things like email addresses and date formats and was wondering if I can create a behavior to do this numeric validation and if so how I would go about it? Should I interrogate the entry using the TextChanged event or something?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>