validation
-
I want to know how should we give validation for phone numbers. my phone number format is 0000-000-000
There are a couple of easy ways 1. Client-side There is a nice ASP.net AJAX control in the toolkit which offers this if you want to use it. Link - http://ajax.asp.net/ajaxtoolkit/MaskedEdit/MaskedEdit.aspx[^] 2. Regular expression validator You could write a simple regular expression to match the input against and use a validator on the page. The regular expression would be something like ^d{4}-\d{3}-\d{3}$ (Not 100% sure of the exact syntax) Try www.regexlib.com as a great source for help and examples of regular expressions.
-
I want to know how should we give validation for phone numbers. my phone number format is 0000-000-000
-
There are a couple of easy ways 1. Client-side There is a nice ASP.net AJAX control in the toolkit which offers this if you want to use it. Link - http://ajax.asp.net/ajaxtoolkit/MaskedEdit/MaskedEdit.aspx[^] 2. Regular expression validator You could write a simple regular expression to match the input against and use a validator on the page. The regular expression would be something like ^d{4}-\d{3}-\d{3}$ (Not 100% sure of the exact syntax) Try www.regexlib.com as a great source for help and examples of regular expressions.
-
I want to know how should we give validation for phone numbers. my phone number format is 0000-000-000
Here is your code for Validation of Phone Number, with asp:regularexpressionvalidator <%@ Page Language=VB Debug=true %> Validating a Phone Number with a RegularExpressionValidator Control
Please enter your phone number:
You must enter a phone number in the form of 9999-999-999.Regards, Satips.:rose:
-
Here is your code for Validation of Phone Number, with asp:regularexpressionvalidator <%@ Page Language=VB Debug=true %> Validating a Phone Number with a RegularExpressionValidator Control
Please enter your phone number:
You must enter a phone number in the form of 9999-999-999.Regards, Satips.:rose:
-
Thanks, but if the first number should be either 3 or 4 so how should we give? like 0000-000-000 or 000-000-000
The first digit is only three. Like wise you have to mention. (999) 999-9999.
Regards, Satips.:rose:
-
Thanks, but if the first number should be either 3 or 4 so how should we give? like 0000-000-000 or 000-000-000
But i have given the code as you have asked for four digit in the first as you stated. If you want you can change the code for three.
Regards, Satips.:rose:
-
But i have given the code as you have asked for four digit in the first as you stated. If you want you can change the code for three.
Regards, Satips.:rose:
-
Thanks .Can we keep both either 3 or 4 in single expression.because some phone no is having 4 digit first and some having 3 digit first.
A kamath wrote:
Can we keep both either 3 or 4 in single expression.because some phone no is having 4 digit first and some having 3 digit first.
Not Both at a time go with any one. Mostly the standard format is (999) 999-9999. like this only. The first three numbers inside braces denotes the Code and the other seven numbers will represents the other. Everywhere you see only 10 didgit phone number only.
Regards, Satips.:rose:
-
A kamath wrote:
Can we keep both either 3 or 4 in single expression.because some phone no is having 4 digit first and some having 3 digit first.
Not Both at a time go with any one. Mostly the standard format is (999) 999-9999. like this only. The first three numbers inside braces denotes the Code and the other seven numbers will represents the other. Everywhere you see only 10 didgit phone number only.
Regards, Satips.:rose:
-
Welcome :)
Regards, Satips.:rose: