Click here to Skip to main content
14,362,614 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

Google it before post it as a question.

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

Use this Regular Expression

<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>
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100