Validating numeric input Xxx social networks
You can click the sample number to test: Since the thousands and decimal separators are various, the field should use type="text" attribute.
When accepting input from an HTML form, you can't assume that the user will provide the right type of data--you have to validate.
go to visual studio - Toolbox - Validation - regular experssion validator drag and drop it where you want error message appear , then set it's " control to validate " property with your textbox id then set the "error message " property to needed error message.
in this article : How to use Required Field Validator validation control with example in and for number type use rangevalidator article: How to use Range Validator validation control with example in use regular experission validator.
(Which actually isn't very common.)First, some code to test the validation. (I have a more complete tutorial on Reg Ex here: Regular Expressions in VB.
I created a quick form with a Text Box, a Button, and two labels occupying the same location to report the answer by making one or the other visible. Click If -- Test for numeric characters -- lbl Not Int. Visible = True End Sub Private Sub Test String In_Text Changed( By Val sender As System.
Another useful function is Vartype() which tells you whether the variable you are using will handle the size of number that you intend to put into it.
validation that the data required would be strictly numeric only.