Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
heeyy..

I am using the textbox that have mobile no.I have o validate the number ..I tried many validation (from the internet)..But if I enter 10 zeros("000000000")... It will take..So can u suggest any javascript or validation to handle this....
Posted

1 solution

Google it before post it as a question.

how to validate phone and mobile number in javascript[^]

Use this Regular Expression

ASP.NET
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
        ControlToValidate="TextBox1" ErrorMessage="Please enter valid Mobile number!"
        ValidationExpression="^([7-9]{1})([0-9]{9})$"></asp:RegularExpressionValidator>
 
Share this answer
 
v2
Comments
aravindnass 7-Jan-13 5:22am    
I tried this but it is not working when 10 zeros is entered...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900