When you create a number input with the proper type value, number, you get automatic validation that the entered text is a number, and usually a set of up and down buttons to step the value up and down. What type tel won’t do is validate if the input is actually a telephone number. The following example code validates a phone number and checks whether the user provided a phone number in … The validating phone number is an important point while validating an HTML form. The allows the user to select a time (no time zone). min - specifies the minimum value allowed. To validate a phone number with a regular expression (regex), we will use type and pattern attribute in HTML input field. Syntax. Most of the world uses postal codes with a combination of letters and numbers and does not call it zip, which is a USPO trademark. Phone Number Validation with Pattern. An element with type="password" that must contain 8 or more characters that are of at least one number, and one uppercase and lowercase letter: