New Input Tag Attributes in HTML 5

A number of new attributes have been added to all input tags in HTML 5. These attributes have the overall effect of reducing the reliance on JavaScript for performing all the client side validation of a form. When browsers start supporting these new attributes it will be possible to take greater control of what can be input into the form fields from the HTML in the page so that the control will still be there even for those visitors without JavaScript.

Of course none of these changes does away with the need for server side validation since anyone wanting to bypass all the client side validation need only use a browser that doesn't support these attributes and has turned off JavaScript for the page containing the form. For that reason there is no point in using these extra attributes to try to restrict what your visitors can do. The purpose of performing validations etc client side is for your visitor's convenience and so as with JavaScript validation, these attributes should only be used where it makes things more convenient for the person filling out the form.

Not all of these new attributes are available for every different type of input field and not all of them will necessarily be needed on those types where they are applicable. You will almost certainly find many occasions where these attributes would be useful though. It is just unfortunate that we have had to wait for HTML 5 for these attributes to be introduced.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow