Validate 10-Digit Mobile Number Using Regular Expression

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.

how to allow only 10 digit mobile number validation using javascript with jquery
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.


#jquery #javascript 

Validate 10-Digit Mobile Number Using Regular Expression
1.00 GEEK