Version 0.6.0

Released 06 January 2015

New features

From v0.6.0, the plugin has new name: FormValidation. It supports validating form created by many frameworks including

  • Add transformer option, allowing to hook the value of field before validating
  • Support add-on
  • Support Zurb Foundation framework
  • Support UI Kit framework
  • Support Semantic UI framework
  • Support Pure framework
  • Add setLocale() and getLocale() methods to support multiple languages
  • Add validateContainer() method
  • Add UAE phone number validator
  • Add EIN validator
  • Add BIC (ISO 9362) validator
  • Add composer.json file
  • Add err, icon, row options
  • Add Spanish postal code validator
  • Support Spanish CIF validator
  • Add India phone number validator
  • Add India postal code validator>

Changes

  • Remove hexColor validator. Use color validator instead
  • Change event error.x.x to err.x.x to avoid window.onerror being invoked by jQuery
  • Remove tab behavior from base class

Improvements

  • Look for the field inside form first when using selector
  • Add allowEmptyProtocol option to set optional protocol in uri validator
  • Improve identical validator
  • Show the credit card icon based on its type
  • Showing tooltip/popover when moving over or clicking the feedback icon (Bootstrap 3.3.0)
  • Use jQuery instead of window.jQuery
  • Allow to reuse data which is returned by the validator
  • Don't need to set the different validator for both fields
  • Improve the CPF validator
  • Add sample data for CPF validator
  • Improve Spanish phone validator
  • Improve Slovenian vat number validator
  • Improve tooltip style when working with Semantic UI form
  • Fix destroying Semantic UI popup
  • Fix typo in UIKit class
  • Validators return true for not supported countries
  • Support to use a Date object as value for min and max options
  • Improve cvv validator
  • uri validator gets slower if more than 25 characters
  • The isValidContainer() method should return null if the container consists of at least one field which is not validated yet or being validated

Bug fixes

  • The cusip validator doesn't work
  • ix the date validator issue where accepts 2014-11-1 23: as valid YYYY-MM-DD h:m date
  • The color validator doesn't provide html5Attributes mapping
  • Update Brazil ID validator to support working with Mask plugin
  • Fix the icon without label class
  • identical validator allows to compare with any input
  • Fix validateContainer() to use map value instead of key
  • Show the validating icon when the field is being validated
  • Fix bug of US phone number validator

Upgrading to v0.6.0

From v0.6.0, the plugin name is changed to FormValidation. To upgrade from v0.5.3 to v0.6.0, perform the following steps:

Required Step: Changing CSS, JavaScript paths

This step is required.

In v0.5.3:

















In v0.6.0:

















Note

Don't confuse bootstrap(.min).js file provided by the Bootstrap framework with bootstrap(.min).js provided by FormValidation which is placed inside the formvalidation/dist/js/framework directory. They are two different files and both of them need to be included as mentioned above

Required Step: Changing your own validator

You can ignore this step in case you don't have any your own validators. Otherwise, change its declaration as following:


// v0.5.3    
(function($) {
    $.fn.bootstrapValidator.validators.yourValidatorName = {
        validate: function(validator, $field, options) {
            ...
        }
    };
}(window.jQuery));    

// v0.6.0
(function($) {
    FormValidation.Validator.yourValidatorName = {
        validate: function(validator, $field, options) {
            // ...
            // The validation code is the same
        }
    };
}(window.jQuery));

Optional Step: Calling plugin

After completing the steps above, you can call the plugin by both programmatic and declarative usages as before.

Using v0.5.3 options as your current one are supported in all v0.6.x releases. It means that you will have a lot of time to upgrade your code while current one still work.

Anyway, it is recommended to change the plugin calling, options which are listed as following:

v0.5.3 v0.6.0
Attribute
Use data-bv-xxx attribute Use data-fv-xxx attribute
Form settings
container err.container
feedbackIcons icon
group row.selector
submitButtons button.selector

$(form).bootstrapValidator({
    container: 'tooltip',
    feedbackIcons: {
        valid: '...',
        invalid: '...',
        validating: '...'
    },
    group: 'td',
    submitButtons: '#submitButton'
});

$(form).formValidation({
    framework: 'bootstrap',
    err: {
        container: 'tooltip'
    }
    icon: {
        valid: '...',
        invalid: '...',
        validating: '...'
    },
    row: {
        selector: 'td'
    },
    button: {
        selector: '#submitButton'
    }
});
Field settings
container err
feedbackIcons icon
group row

$(form).bootstrapValidator({
    fields: {
        fieldName: {
            container: 'tooltip',
            feedbackIcons: false,
            group: '.col-sm-3',
            validators: {
                ...
            }
        }
    }
});

$(form).formValidation({
    framework: 'bootstrap',
    fields: {
        fieldName: {
            err: 'tooltip',
            icon: false,
            row: '.col-sm-3',
            validators: {
                ...
            }
        }
    }
});
Events

There are two changes about the event names:

  • The namespace .bv is changed to .fv
  • The namespace error. is changed to err. to avoid window.onerror being invoked by jQuery
init.form.bv init.form.fv
error.form.bv err.form.fv
success.form.bv success.form.fv
added.field.bv added.field.fv
removed.field.bv removed.field.fv
init.field.bv init.field.fv
error.field.bv err.field.fv
success.field.bv success.field.fv
status.field.bv status.field.fv
error.validator.bv err.validator.fv
success.validator.bv success.validator.fv

The last thing, the hexColor validator, deprecated in v0.5.3, is replaced with color validator.