The following example displays a numeric input field, where you can enter a value from 1 to 5: Here is a list of some common input restrictions: You will learn more about input restrictions in the next chapter. Its value can, however, still be changed by JavaScript code directly setting the HTMLInputElement.value property. How to Format a License Number. Features: Input fields that accept phone numbers use the "tel" type. The form-handler is specified in the form's action is It should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. pattern The pattern keyword lets you define a regular expression template for the string value. For example, "9.52" is valid, but "9.521" is not. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. The is used for input fields that should contain a telephone number. Valid values are number and string. The Input Tag Helper is applied on the HTML elements. The Envato Market license number or purchase code, for example, is 36 characters long and comprises letters, numbers, and a few dashes. How an works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages. Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor. The is used for input fields that should contain a date. single-line text input field: This is how the HTML code above will be displayed in a browser: defines a password field: The characters in a password field are masked (shown as asterisks or circles). However, you can set restrictions on what Let's take a closer look. If you didn't do this, you'd have to fill in both feet/inches and meters to submit the form! The full numeric keypad makes a great user experience. If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: defines a button for Tip: Always add the