Version v1.1.0

Released 8 July 2018

This verion brings support for Internet Explorer 11 (because the previous version is compiled to ES6 compatible code which doesn't work in Internet Explorer 11).

It also adds new plugins to support better user experience such as:

  • Stop performing remaining validators if there is a validator that the field does not pass, via the Sequence plugin
  • Be able to postpone the validation for a given number of seconds from the moment user stops fill in the field via the Trigger plugin

For more details, take a look at the next sections.

New features

New Sequence plugin

By default, all validators for given field will perform their jobs after each key stroke. In the previous version, there is no way for us to control the order of their executions.

The Sequence plugin allows us to pending the execution of a validator until all previous validators are pass.

In the following example, we use the remote validator, which is an expensive validator because it will hit the server and takes time to perform and returns the result to our user. By putting it at the end of field validators, we only send a request to server to check if the username is taken if it passes all other validators.

New StartEndDate plugin

The StartEndDate plugin is very handly if you want to validate start and end dates. We can use it with or without a date picker library.

The example below uses the flatpickr, a lightweight and powerful datetime picker.

Support invisible reCAPTCHA

The Recaptcha plugin now supports invisible reCAPTCHA:

Improve Trigger plugin

The Trigger plugin adds a new delay option that supports pending validation for a given number of seconds after user stops filling in the field.

In the following form, the username field validations will be postponed for 3 seconds after user stops filling in the field. Other field will be validated instantly right after each key stroke.

Improvements

  • The min, max options in the date validator accept a function returning a Date object or a string
  • For each field, all validators are performed in a sequential order
  • Remove the timeout option in the Recaptcha plugin. The captcha expiration will be handled by the plugin automatically
  • Remove unused stoken option in the Recaptcha plugin
  • Add new option in the Recaptcha plugin to support back-end verification
  • Hide the clear field icon on Internet Explorer. So you will not see two icons when using with the Icon plugin

Bug fixes

  • The library is now compatible with Internet Explorer 11. Behind the scene, we use Babel to compile the ES6 code into ES5 compatible code
  • Fix an issue that the updateFieldStatus() method ignores the validator parameter when setting the field status
  • Fix an issue that the valid/invalid CSS classes aren't removed from field element when executing resetForm, resetField methods
  • Fix an issue that the field element doesn't reset value when executing resetForm, resetField methods

Upgrading to v1.1.0

  • From v0.8.1 and older versions: Follow the Upgrading to v1.0.0 guide
  • From v1.0.0: Just download the new version and replace the old files in v1.0.0 with new files in v1.1.0.
Download v1.1.0