List of New HTML5 Form Elements
See below for a list of the new attributes which we will examine here.
We have provided simple code examples below of some of our favourite new attributes.
Autofocus is another HTML attribute which aims to simplify common Front-End tasks by making them part of the standard HTML5 specification.
HTML5 Form Validation
HTML5 brings in form validation directly from the markup as standard.
Regular expressions are generally used for processing most content entered into a form, but HTML5 can make some elements easy to check without hardly any code at all. This is ideal for those occasions where you are looking to setup some forms quickly and without the need for such precise Regular Expressions on the inputted data.
Simple validation for emails, directly from HTML5.
Simple validation for web urls, directly from HTML5.
Different browsers will provide alternative solutions to your use of number spinboxes, also dependent on the type of device you are using, be it desktop, tablet or mobile.
Sldiers are easy and quick ways for users to enter numeric entries into web forms, HTML5 offers these up through supporting browsers. You may need to consider your users and how familiar they are with such interactions before using them.
Date Pickers have been used by web developers and designers for a long time and it was this frequent use that made it such an obvious inclusion into the HTML5 specification. All browsers will take these HTML5 standards and produce their own versions of it, with a good level of consistency across most of the major browsers and devices.
Some browsers will customised inputs into search boxes, given the correct HTML5 markup. Safari is one of the more responsive browsers for this feature.
Use required to check directly that all required fields have had something entered. You might then use HTML Pattern to check more specifically at what was entered.