Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.
dilvie edited this page Oct 24, 2012 · 13 revisions

h5Validate RoadMap

I opened this up to make room for design discussion. There are major changes coming to the 1.0 API. The most important change will be the public event API.

What is h5Validate?

h5Validate is an HTML5 polyfill that allows you to use some of the most practical and best features of the HTML5 form validation spec today, in all major browsers dating back to IE6. Specifically, it adds support for the pattern and required attributes, which, on their own, cover most of the validation requirements you encounter.

What Will h5Validate Be in the Future?

We plan to support all of the new HTML5 input types and validation methods in the specification. Progress on this has been slow as we've waited for various browser implementations to implement and stabilize the new HTML5 features.

Events (implemented)

Trigger the 'validate' event to validate either a whole form, or an individual field. (Only works for individual field right now).

Listen for 'validated' to get back the ValidityState.

Listen for 'formValidated' to get back the ValidityState collection for the whole form.

Using the event API, it will be easier to add asynchronous operations (such as custom Ajax validation).

Validation Types (partial implementation)

h5Validate currently supports three validation types: pattern, required, and validValues. We'll be adding more of these, particularly those that support the new HTML5 input types -- what's better, though: You'll be able to pass in your own custom validation types in the configuration, and bind them up to the HTML with your own class names.

Broader standard implementation

We really want to support all of the new input types, but some of them have custom browser UI that is tricky to override.

It would be great if we could fall back on the native browser validations to determine whether or not an input is valid, but currently, there is no way to do this without bringing up the native browser error messaging, which does not allow for custom styling. This effort will be a high priority going forward, but it is stalled right now because it requires some revision to the specification, browser implementations, and will require some browser bug fixes (there are still open browser bugs in multiple browsers for false positive errors).

Known Issues

h5Validate does not currently attempt to support every aspect of HTML5 forms. Selecting input type="email" will not automatically select the email validation pattern, and so on. If you can, please help create test cases for new input types so that this phase of development can move forward faster.

h5Validate ignores the novalidate and formnovalidate attributes, because it uses them to override native browser validation behaviors (most of which do not conform to inline form validation best practices at this time, and do not allow enough flexibility in how error messages get displayed). As far as I know, currently, this is the ONLY way to override native browser validation behaviors.

In order to prevent h5Validate from attempting a validation, add the .novalidate class to elements you want to skip.