How To Validate 10 Digit Mobile Number Using Regular Expression

Posted on

In this article we will see how to validate 10 digit mobile number using regular expression in PHP or Laravel. here i will give you example of regex for 10 digit mobile number in jQuery.

Regular Expression through user can enter numbers in different format as per their requirements. When we are working with form validation at that time you need to restrict user to enter invalid value and users allow only numeric value or valid number.

So let’s see regular expression for 10 digit mobile number

Example :

<html>
<head>
   <title>How To Validate 10 Digit Mobile Number Using Regular Expression - techsolutionstuff.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>How To Validate 10 Digit Mobile Number Using Regular Expression - techsolutionstuff.com</h1>
   <div class="col-md-6">
    <label>Mobile Number: </label>
    <input class="form-control" type="text" name="mo_no" placeholder="Mobile Number" minlength="10" maxlength="10" required>
    <br>
    <label>Mobile Number: </label>
    <input type="text" class="form-control" name="mo_no" placeholder="Mobile Number" pattern="[1-9]{1}[0-9]{9}"  required ><br>
    <button type="submit" class="btn btn-success">Submit</button>
  </div>
</form>
</body>
</html>
Enter fullscreen mode

Exit fullscreen mode


How To Validate 10 Digit Mobile Number Using Regular Expression<br />
” loading=”lazy”></a></p>
<hr>
<p>You might also like :</p>
<ul>
<li>
<p><strong><em><a href=Read More : Laravel 6 CRUD Tutorial with Example

  • Read More : Laravel Datatable Example Tutorial

  • Read More : Create Dummy Data Using Tinker In Laravel

  • Leave a Reply

    Your email address will not be published.