ASP.NET MVC Html.textbox - How to check only numbers?
2 answers
If the datatype on the model is numeric (int, etc.), you can simply use the attribute and enable client validation. More details here .
+6
source to share
Another option is to use jquery validation plugin .
This will allow you to simply add the "required numbers" class and it will do the validation magic for you.
+1
source to share