Today, We want to share with you 10 digit mobile number validation in jquery.In this post we will show you jquery validate phone number format, hear for how to validate 10 digit mobile number using regular expression in laravel or php. we will give you demo and example for implement.In this post, we will learn about MOBILE NUMBER VALIDATION IN JQUERY with an example.
How to check only 10 digit mobile number regex?
first of all, i validate a phone number of 10 digits with no comma, no spaces, no punctuation as well as there will be no + sign in front the number.
You need to copy below source code in your view or html file to get output.
index.html
<html> <head> <title>Allow only 10 digit mobile no using regular expression - www.pakainfo.com</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> <body> <form> <h1>Allow only 10 digit mobile no using regular expression - www.pakainfo.com</h1> <div class="col-md-6"> <label>Mobile Number: </label> <input class="form-control" type="text" name="mobile_number" placeholder="Enter your Mobile Number" minlength="10" maxlength="10" required> <br> <label>Mobile Number: </label> <input type="text" class="form-control" name="mobile_number" placeholder="Enter your Mobile Number" pattern="[1-9]{1}[0-9]{9}" required ><br> <button type="submit" class="btn btn-success">Submit</button> </div> </form> </body> </html>
I hope you get an idea about jquery validate phone number regex.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.