The latest version v1.4.0

Released 20 April 2019

New features

The id validator supports validating more national identification numbers, including:

Validator Local name
Argentinian identification number DNI
Colombian identification number NIT
French identification number NIR
Hong Kong identification number HKID
Indian identification number Aadhaar
Korean identification number RRN
Malaysian identification number NRIC
Mexican identification number CURP
Norwegian identification number Fødselsnummer
Peruvian identification number CUI
Taiwanese identification number -
Uruguayan identification number -

The Declarative plugin now supports plugin declarations


...
document.addEventListener('DOMContentLoaded', function(e) { const form = document.getElementById('demoForm'); FormValidation.formValidation(form, { plugins: { // You have to register the Declarative plugin only declarative: new FormValidation.plugins.Declarative() } }); });

It serves the same functionalities such as declaring plugins as


...
document.addEventListener('DOMContentLoaded', function(e) { const form = document.getElementById('demoForm'); FormValidation.formValidation(form, { plugins: { declarative: new FormValidation.plugins.Declarative(), // Other plugins trigger: new FormValidation.plugins.Trigger(), tachyons: new FormValidation.plugins.Tachyons(), submitButton: new FormValidation.plugins.SubmitButton(), icon: new FormValidation.plugins.Icon({ valid: 'fa fa-check', invalid: 'fa fa-times', validating: 'fa fa-refresh', }), } }); });

Improvements

  • Separate id validators to id package to save imports when using with ES6 module.

In the previous versions, you need to import the whole id package if you only want to validate the identification number of particular country:


// You might need to change the importing path
import id from 'formvalidation/validators/id';

const result = id().validate({
    value: ...,
    options: {
        country: 'BR',
        message: 'The input is not a valid Brazilian identification number',
    },
});

This version provides the specfic module for each country. As the result, it saves a lot of size when your application is bundled with popular bundlers as Webpack, Rollup, etc.


// You might need to change the importing path
import brId from 'formvalidation/validators/id/brId';

const result = brId().validate('An ID here');
  • Separate vat validators to vat package to save imports when using with ES6 module.
  • In the last version, the Recaptcha plugin doesn't hide the error message and error icon when user click the captcha checkbox. The error icon disappears when the captcha is expired. This version fixes that.
  • Support the latest version of TurretCSS (v5.1.3).
  • The vat validator supports Swiss VAT numbers that end with TVA, IVA, TPV.

Bug fixes

  • Upgrade source code to be compatible with the latest Tyescript version (3.4.4).
  • Fix an issue that the ismn validator passes an invalid ISMN which ends with 0.
  • Fix an issue that the meid validator passes an invalid MEID which ends with 0.
  • The iban validator supports the new format of Costa Rica IBAN number (22 digits currently).
  • Fix an issue that icon is displayed at wrong position for Spectre form.
  • Fix an issue that the Message plugin doesn't ignore field on IE11

Upgrading to v1.4.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.4.0.
Download v1.4.0