This site contains the document for old version. Please upgrade to the latest version v1.0.0

News

The latest news about FormValidation

FormValidation v0.8.1 is released, supports Bootstrap 4 alpha 3

Improvement

Document

Please take a look at the Upgrading guide if you want to upgrade from v0.7.1 to v0.8.x

Download

Upgrading to v0.8.0

FormValidation v0.8.0 supports both Bootstrap 3/4 as well as Foundation 5/6.

You need to perform the following changes if you want to try Bootstrap 4 (alpha) or still want to use Foundation 5:

Step 1: Including the correct files

This section is already mentioned in the Including library section:

<!-- Bootstrap CSS v4.0.0 alpha -->
<link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.min.css">

<!-- FormValidation CSS file -->
<link rel="stylesheet" href="/vendor/formvalidation/dist/css/formValidation.min.css">

<!-- jQuery v1.9.1 or higher -->
<script src="/vendor/jquery/jquery.min.js"></script>

<!-- Tether library, which is required if you want to use Bootstrap tooltip -->
<script src="/vendor/tether/js/tether.min.js"></script>

<!-- Bootstrap JS -->
<script src="/vendor/bootstrap/js/bootstrap.min.js"></script>

<!-- FormValidation plugin and the class supports validating Bootstrap form -->
<script src="/vendor/formvalidation/dist/js/formValidation.min.js"></script>
<script src="/vendor/formvalidation/dist/js/framework/bootstrap4.min.js"></script>

Don't confuse bootstrap(.min).js file provided by the Bootstrap framework with bootstrap4(.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.

<!-- Foundation v5 CSS -->
<link rel="stylesheet" href="/vendor/foundation/css/normalize.min.css">
<link rel="stylesheet" href="/vendor/foundation/css/foundation.min.css">

<!-- FormValidation CSS file -->
<link rel="stylesheet" href="/vendor/formvalidation/dist/css/formValidation.min.css">

<!-- jQuery v1.9.1 or higher -->
<script src="/vendor/jquery/jquery.min.js"></script>

<!-- Foundation JS file -->
<script src="/vendor/foundation/js/vendor/modernizr.js"></script>
<script src="/vendor/foundation/js/foundation/foundation.js"></script>
<script src="/vendor/foundation/js/foundation/foundation.tooltip.js"></script>

<!-- FormValidation plugin and the class supports validating Foundation form -->
<script src="/vendor/formvalidation/dist/js/formValidation.min.js"></script>
<script src="/vendor/formvalidation/dist/js/framework/foundation5.min.js"></script>

Don't confuse foundation(.min).js file provided by the Foundation framework with foundation5(.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.

Step 2: Setting the framework option

You need to set the framework option as following:

$(yourForm).formValidation({
    framework: 'bootstrap4',
    ...
});
$(yourForm).formValidation({
    framework: 'foundation5',
    ...
});

FormValidation v0.8.0 is released, supports Bootstrap 4 alpha and Foundation 6

Highlight

This version of FormValidation works with the latest versions of supported frameworks, including:

  • #512: Foundation v6
  • #616: Bootstrap v4 (alpha 2) by setting framework: 'bootstrap4'
  • PureCSS v0.6.0
  • Semantic UI v2.1.8
  • UIKit v2.26.3

Changes

If you want to try Bootstrap 4 alpha 2 or still want to use Foundation 5, you need to follow the upgrading to v0.8.0 guide

Improvements

  • #536, #613: The creditCard validator now supports more card types (Dankort, Elo, Forbrugsforeningen, Maestro International, Visa Electron)
  • #546: The ip validator now supports CIDR notation
  • #556: Return more information of the file validator result, so user can display associated message if the selected file doesn't match given extension, type or size
  • #607: Pass validator along to the status.field.fv event

Bug fixes

  • #315, #600: Using formnovalidate attribute causes IE to send two postbacks to server, thanks to @dtkujawski
  • #364, #593, #611: Form cannot submit with live mode disabled (live: 'disabled') and form has some radios/checkboxes
  • #488: Fix an exception when calling destroy() if a field is replaced manually
  • #501: The cvv validator doesn't work properly if we transform the credit card value
  • #599: The phone validator should accept valid US phones such as 999 999 9999

Document

Download

FormValidation v0.7.1 Released

New features

  • #266: Add new priority option that allows to set the validator execution order
  • #275: Add rst.field.fv and rst.form.fv events that are triggered after calling resetField() and resetForm() methods, respectively
  • #291: The regexp validator provides new flags option to use in declarative mode
  • #313: The remote validator supports synchronous via new async option
  • #393: The id validator now supports Turkish identification number

Improvements

  • #245: The mac validator now supports all formats of IEEE 802 standards
  • #256: Support UIKit form-password component
  • #308: The fields of fields option provided by the different validator can be separated by a comma with or without a space
  • #312: The phone validator adds support for (123) 456-7890 US phone numbers

Bug fixes

  • #311: Fix an issue caused by the date validator when the min, max options follows the same format as format
  • #324: The numeric validator accepts numbers without a preceding zero
  • #395: The ein validator now supports identification numbers that start with "47-"
  • #410: Fix the typo in German language package
  • #465: The updateMessage() method doesn't work properly if the selector contains multiple class names

Document

Download

FormValidation v0.7.0 Released

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

Old New
be_FR fr_BE
be_NL nl_BE
gr_EL el_GR

Improvements

  • #151: integer validator accepts leading zeros
  • #163: 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
  • #165: integer and numeric validators support more locales by providing new thousands and decimal separator options
  • #233: When using tooltip for multiple fields, it always shows on the last field
  • #234: 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

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

Document

Download

← Older Newer →