A regular expression can easily check whether a user entered something that looks like a valid phone number.
Regular expressions are patterns used to match character combinations in strings.
And in the case of the web, Java Script is the best option available for validating input client-side.You can find many solutions on the web but I found that the most of these solutions are to validate the phone number from one text box. The following image shows phone number input fields (eg: 1) Basically, there are two to validate the phone numbers. The second is to have the phone number not mandatory but if the user enters in any one of the three textbox fields, then the validation takes place.Method 2 Validation Conditions Each textbox field should pass the following validation.Now we will see how we can validate our entered form data before submitting it to the web server.The following example shows how to validate an entered email address.