Version 0.7.0

Released 01 August 2015

New features

Allow to use multiple instance of validators via new alias option.

You can registry a new validator which is actually a built-in validator as following:


$(form).formValidation({
    framework: '...',
    fields: {
        username: {
            validators: {
                required: {
                    alias: 'notEmpty',
                    message: 'The username is required'
                }
            }
        }
    }
});

or use multiple instance of same validators (for example, callback, as following piece of code):


$(form).formValidation({
    framework: '...',
    fields: {
        password: {
            validators: {
                checkUppercase: {
                    alias: 'callback',
                    message: 'The password must have at least one uppercase character',
                    callback: function(value, validator, $field) {
                        ...
                    }
                },
                checkLowercase: {
                    alias: 'callback',
                    message: 'The password must have at least one lowercase character',
                    callback: function(value, validator, $field) {
                        ...
                    }
                },
                checkDigits: {
                    alias: 'callback',
                    message: 'The password must have at least one digit',
                    callback: function(value, validator, $field) {
                        ...
                    }
                },
                checkSpecial: {
                    alias: 'callback',
                    message: 'The password must have at least one special character',
                    callback: function(value, validator, $field) {
                        ...
                    }
                }
            }
        }
    }
});

Changes

Change the file name and definition of some language packages:

Old New
be_FR fr_BE
be_NL nl_BE
gr_EL el_GR

Improvements

  • integer validator accepts leading zeros
  • between, greaterThan, lessThan validators now show the message where %s are replaced with the min, max, value options when the input isn't a number
  • integer and numeric validators support more locales by providing new thousands and decimal separator options
  • When using tooltip for multiple fields, it always shows on the last field
  • Adjust the default messages when using the stringLength validator
  • The Spanish id, vat validators add type to the return value. The type can be DNI, NIE or CIF.

Bug fixes

  • Fix an issue on IE 10/11 that causes an input element with placeholder attribute to be validated automatically when it's focused
  • Fix the bug that the isValidContainer() method doesn't ignore field which validators are totally disabled
  • The field's enabled option doesn't work in declarative mode
  • Fix the bug causing the message option for form isn't used. The plugin uses default message provided by each validator instead