HTML5 Attributes and Field Validation

In addition to new field types, HTML5 input fields include a number of new field attributes. This section describes which attributes are supported by fcForms and by which browsers.
All of these attributes are optional but can be combined for each of your different applicable field types.

Required

HTML5 has introduce a new "required" attribute that should not allow submission if the field is empty. All fields except the Checkbox field can have this attribute. This attribute is supported by Chrome, Internet Explorer and FireFox, but not yet for Safari. However fcForms has implemented a javascript alternative for Safari.

Placeholder

The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).
The short hint is displayed in the input field before the user enters a value. This is supported by all browsers tested.

Number Min and Max

Chrome and Internet Explorer support the Min and Max attribute for number fields. Neither Safari nor FireFox do.

Pattern

It specifies a JavaScript regular expression for the field’s value to be checked against. pattern makes it easy for us to implement specific validation for product codes, invoice numbers, and so on. The possibilities for pattern are wide-ranging. Check out http://html5pattern.com for examples
The Pattern attribute is supported by Chrome, Internet Explorer and FireFox, but NOT Safari.

Previous Page: HTML5 Field Input Types Supported Table of Contents Next Page: Customizing the CSS