Input phone number pattern validation


Solutions Input phone number pattern validation HTML Input Field Phone Number Validation

For validation of input mobile number we have to use the pattern attribute of the input field. First we restrict the number to start from '92' or country code the followed by 10 digits. The country code and the followed digits may change by country to country.

<input pattern="(92)\d{10}" placeholder="Enter phone number. . . E.g 923441234567 ">

Live Demo

Solutions HTML Input Field Phone Number Validation Chapter Next »