HTML 5 New Form Fields

HTML 5 has introduced a number of new types of input fields that can be used in your forms. There are also new tags that also relate to forms.

Here are the new types that the input field in HTML 5 supports.

Unlike many of the proposed new tags that simply duplicate what is already available, all of these (except for search and perhaps tel) provide the opportunity to add new and useful form control tools into web browsers.

In addition to this there are also some additional attributes that have been added both to the new types and the existing ones that will also be useful such as the list attribute that allows a <datalist> to be attached to the field converting it into a combobox. Many of the input types allow a pattern attribute to be specified supplying a regular expression that can be used to validate the input and a required attribute to specify which fields are required to have values entered. The autofocus attribute indicates which form field should be given the focus when the page first loads. All of these attributes reduce the form's dependence on JavaScript for the client side validation and hence will make it easier to create forms that can provide decent feedback to the person filling them out without needing to have JavaScript enabled.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate