Fork me on GitHub
programer.tips, another cool thing from @nghuuphuoc!

News

The latest news about BootstrapValidator

BootstrapValidator v0.5.2 Released

New features

  • #480: Add verbose option, thanks to @mbezhanov
  • #542, #666: Add blank validator, thanks to @bermo
  • #617: Add init and destroy methods to validator
  • #724: Add Venezuelan VAT number (RIF) validator, thanks to @paquitodev
  • #739: Add China phone number validator, thanks to @caijh
  • #743: Add Venezuela phone number validator, thanks to @paquitodev
  • #760: Add Romania phone number validator, thanks to @adrian-dks
  • #761: Add Romania postal code validator, thanks to @adrian-dks
  • #785: Add Denmark phone number validator, thanks to @emilchristensen
  • #787: Add Thailand phone number and ID validator, thanks to @figgaro
  • #793, #798: Add Chinese citizen ID validator, thanks to @shamiao
  • #802: Add Russia phone number validator, thanks to @cylon-v. #816: Improved by @stepin
  • #816: Add Russian postal code validator, thanks to @stepin
  • #867: Add Czech and Slovakia phone number and postal code validators, thanks to @cuchac

Changes

  • #753: Change the default type of remote validator to GET

Improvements

  • #249, #574, #669: Add delay option to the remote validator, thanks to @q-state
  • #345, #454: The different validator allows more than a 2-way comparison, thanks to @AlaskanShade
  • #557, #569: The container option can be defined by a callback, thanks to @mattrick
  • #570: Use CSS classes instead of inline styling to fix icons with input-group, thanks to @dlcrush
  • #578, #813: The stringLength validator supports HTML 5 minlength attribute, thanks to @emilchristensen
  • #675: The emailAddress validator accepts multiple email addresses, thanks to @kenny-evitt
  • #716, #765: Reuse data returned by callback, remote, custom validators
  • #734: The uri validator adds support for custom protocol, thanks to @bcamarneiro
  • #737: Support VAT number without prefixing by country code
  • #754: Support latest Bootstrap when using tooltip/popover to show the message
  • #783: Improve behaviour of the different validator
  • #792: Add "BootstrapValidator's JavaScript requires jQuery" warning, thanks to @Arkni
  • #803: Add minSize option for the file validator, thanks to @Arkni
  • #824: Add phone number validator test suite

Bug fixes

  • #611, #703: Tabs get red even form is valid
  • #612, #740, #741: Fix the emailAddress issue which email@server is not valid email address, thanks to @kromit
  • #687, #711: Keep disabled validators VALID, thanks to @talberti
  • #725: Fix the issue when adding field which does not exist but is already set in "fields" option
  • #732: Fix the issue when removing the radio or checkbox field
  • #746: The form is still submitted when clicking on submit button which is set onclick="return false;"
  • #758: Using notEmpty validator with type="number"
  • #759, #764: The tooltip/popover isn't shown if there is disabled validator. The tooltip/popover is shown automatically when the field gets the focus, thanks to @leedorian
  • #797, #799: Can't validate ipv4 and ipv6 at the same time. Add ip validator test suite, thanks to @Arkni
  • #816: Fix Russian VAT number validator, thanks to @stepin
  • #832: The form won't be validated if the submit button contains a HTML tag

Document

Language Packages

  • #706: Japanese language package, thanks to @tsuyoshifujii
  • #712: Swedish language package, thanks to @ulsa
  • #727: Belgium (French) language package, thanks to @neilime
  • #729: Persian (Farsi) language package, thanks to @i0
  • #779: Romanian language package, thanks to @filipac
  • #787: Thai language package, thanks to @figgaro
  • #788: Fully re-translated Simplified Chinese language package, thanks to @shamiao
  • #795: Re-translated traditional Chinese language package, thanks to @tureki
  • #802: Russian language package, thanks to @cylon-v. #816: Improved by @stepin
  • #806: Ukrainian language package, thanks to @oleg-voloshyn
  • #840: Serbian language package, thanks to @markocrni
  • #856: Norwegian language package, thanks to @trondulseth
  • #868: Indonesian language package, thanks to @egig

Upgrade from v0.5.x to v0.5.2

If you don't use the remote validator, just download v0.5.2 package and override the CSS/JS bundle.

Otherwise, please indicate the type option when using remote validator:

$(form).bootstrapValidator({
    fields: {
        username: {
            message: 'The username is not valid',
            validators: {
                // The validator will create an Ajax request
                // sending { username: 'its value' } to the back-end
                remote: {
                    message: 'The username is not available',
                    url: '/path/to/backend/',
                    type: 'GET'     // or 'POST'
                }
            }
        }
    }
});

Contributors

Thanks to 30 contributors:

Download

BootstrapValidator v0.5.1 Released

New features

Improvements

  • #502: Allowing sites without TLD to pass URI validation, thanks to @troymccabe
  • #549, #600: Change the CSS/JS path in demo/remote.html and demo/message.html, thanks to @leegtang, @Arkni
  • #604: Fix the demo/date.html and demo/tab.html examples, thanks to @Arkni
  • #609: Add content-type header for demo/remote.php, thanks to @etorres
  • #661: Add headers option to the remote validator, thanks to @ryan2049
  • #664: Fix the feedback icon position for Bootstrap 3.2
  • #683: Force the format option to be YYYY-MM-DD when using <input type="date" />
  • #698: Ignore type checking if the file type is empty

Bug fixes

  • #284, #294, #441, #516: The HTML 5 <input type="number" /> input allows to input non-digits characters
  • #548: Fix the issue when using different validator to compare with not existing field
  • #550, #551: Cannot validate against both ipv4 and ipv6 at the same time, thanks to @beeglebug
  • #588: Don't use min, max attributes (greaterThan, lessThan validators) for <input type="date" />
  • #665: The submitButtons option doesn't work correctly
  • #672: The zipCode validator throw an exception when passing not supported country code
  • #681: Fix the date validator issue where one of date/month/year or hours/minutes/seconds is prefixed by zero
  • #692: The remote validator can't set the type option via HTML attribute
  • #700: The between, greaterThan, lessThan validators accept param which isn't number

Language Packages

  • #396: German language package, thanks to @logemann
  • #474: Hungarian language package, thanks to @blackfyre
  • #478: Simplified and traditional Chinese language package, thanks to @tureki
  • #494: Chilean Spanish language package, thanks to @marceloampuerop6
  • #400: Italian language package, thanks to @maramazza
  • #503: French language package, thanks to @dlucazeau
  • #505: Czech language package, thanks to @AdwinTrave
  • #507: Polish language package, thanks to @grzesiek. #624: Typos fixed by @lukaszbanasiak
  • #517: Belgium (Dutch) language package, thanks to @dokterpasta
  • #527: Bulgarian language package, thanks to @mraiur
  • #534: Turkish language package, thanks to @CeRBeR666
  • #536: Spanish language package, thanks to @vadail
  • #544: Greek language package, thanks to @pRieStaKos
  • #545: Portuguese (Brazil) language package, thanks to @marcuscarvalho6
  • #598: Danish language package, thanks to @Djarnis
  • #674, #677: Dutch language package, thanks to @jvanderheide
  • #679: Add Arabic language package, thanks to @Arkni

Contributors

Thank to the contributor:

Download

Upgrading to v0.5.0

From v0.5.0, we remove the submitHandler option. In v0.5.0, use the success.form.bv event instead.

In v0.4.5 and earlier versions:

$(form).bootstrapValidator({
    submitHandler: function(form, validator, submitButton) {
        ...
    }
});

In v0.5.0:

$(form)
    .bootstrapValidator({
        // Removing submitHandler option
    })
    .on('success.form.bv', function(e) {
        // Prevent form submission
        e.preventDefault();
        var $form        = $(e.target),
            validator    = $form.data('bootstrapValidator'),
            submitButton = validator.getSubmitButton();
        // Do whatever you want here ...
    });

Download

BootstrapValidator v0.5.0 Released

New features

Error message

  • #2, #387: Provide the default message
  • #93, #385: Support translating error messages
  • #282, #347, #465: Support dynamic message

Events

Support dynamic option

Support dynamic fields

New options

  • #164: Add container option for indicating the element showing all errors
  • #175: Showing errors in tooltip or popover
  • #297: Add feedbackIcons option to enabled/disable feedback icons for particular fields
  • #356: Add group option
  • #420: Add enabled option enable/disable particular validator
  • #422: Add excluded option to exclude particular field

New APIs

Misc

Changes

  • $.fn.bootstrapValidator.helpers renames mod_11_10 to mod11And10, mod_37_36 to mod37And36
  • Remove submitHandler option. See upgrading to v0.5.0 guide.

Improvements

  • #244: Only enable the submit buttons if all fields are valid, thanks to @smeagol74
  • #262: Improve the updateStatus() method. The plugin now doesn't show the errors, feedback icons of given field if there are uncompleted validators
  • #274: Fix feedback icons in input-group, thanks to @tiagofontella
  • #287, #291: Only send the submit button which is clicked. It's an enhancement for #238
  • #348: The uri validator now provides an option to support private/local network address
  • #364: Clicking the feedback icon also effect to the checkbox, radio fields
  • #366: Don't change the enable setting when the new one is the same
  • #382: Add JSHint to Grunt build
  • #388: Allow to override the default options. Useful for using multiple forms in the same page
  • #393: The remote validator adds support for dynamic url and method type (GET/POST), thanks to @ericnakagawa
  • #426: Add test suite
  • #431: Add built time to the build file
  • #432: Define the callback via data-bv-callback-callback attribute
  • #451: Validation of numeric fields with decimal steps, thanks to @Azuka
  • #456: Adjust the feedback icon position for .input-group element

Bug fixes

  • #288: Fix date validator issue on IE8
  • #292: Fix identical validator issue with not clearing has-error class, thanks to @alavers
  • #305, #306, #307: Fix inclusive option in the between, greaterThan and lessThan validators, thanks to @johanronn77
  • #310, #475: The date validator still return valid if the value doesn't contain digits
  • #311: file validation extension is case sensitive
  • #312: Fix broacast typo in the uri validator, thanks to @mrpollo
  • #313: Fix the file validator issue on IE 8
  • #314: The creditCard validator doesn't work on IE 8
  • #315: The cvv validator doesn't work on IE 8
  • #325: The threshold option doesn't work on IE 8
  • #358: The zipCode validator doesn't work for Canadian zip code
  • #371, #483, #487: Added the letters 'H', 'W' and 'Z' in letter list for Canada postal code, thanks to @jzhang6
  • #375: Don't submit form when the callback validator completes and the submit button isn't clicked
  • #377: The id, vat validators should return false if the country code is not supported
  • #389: When using multiple forms with HTML attributes on the same page, the plugin options will be the same as the last one
  • #401: stringLength validator allows spaces after max length
  • #411: Fix the ean validator when the check digit is zero, thanks to @manish-in-java
  • #417: IPv6 validator doesn't work
  • #425: Custom trigger event is ignored by field validators
  • #447: Skip the _isExcluded() when initializing the form. This fixes #269, #273. Thanks to @AlaskanShade
  • #492, #493: Fixed Chilean ID (RUT/RUN) finished in 'K' or 'k', thanks to @marceloampuerop6

Language Packages

  • #396: German language package, thanks to @logemann
  • #474: Hungarian language package, thanks to @blackfyre
  • #478: Simplified and traditional Chinese language package, thanks to @tureki
  • #494: Chilean Spanish language package, thanks to @marceloampuerop6

Document

  • #259: Typo "Support almost Bootstrap forms", thanks to @lloydde
  • #261: English fix to 'amazing contributors' section, thanks to @lloydde
  • #278: Update the choice validator document, thanks to @MrC0mm0n
  • #303: Fix typo in remote validator document, thanks to @MartinDevillers
  • #334: No ID is specified on the form object for registration, thanks to @jjshoe
  • #423: Add default column to settings table, thanks to @MartinDevillers
  • #452: Update 'United State' to 'United States', thanks to @mike1e

Upgrading to v0.5.0

See upgrading to v0.5.0 guide.

Contributors

Thank to the contributor:

Download

BootstrapValidator v0.4.5 Released

New features

Improvements

  • The zipCode validator adds support for Italian, Dutch postcodes
  • Change default submitButtons to [type="submit"] to support input type="submit"
  • #245: The cvv validator should support spaces in credit card, thanks to @evilchili

Bug fixes

  • Fix the issue that the hidden fields generated by other plugins might not be validated
  • When parsing options from HTML attributes, don't add the field which hasn't validators. It improves fixes for #191, #223
  • #226: Fix the conflict issue with MooTools
  • #238: The submit buttons are not sent
  • #253: The iban validator does not work on IE8
  • #257: Plugin method invocation don't work

Contributors

Thank to the contributor:

Download

BootstrapValidator v0.4.4 Released

New features

Improvements

  • #191, #223: Support using both the name attribute and selector option for field
  • #206: Indicate success/error tab
  • #220: Add UK postcode support for the zipCode validator
  • #229: The date validator supports seconds

Bug fixes

  • #231: Wrong prefix of Laser credit card number

Download

BootstrapValidator v0.4.3 Released

New features

Improvements

Bug fixes

Document

Contributors

Thank to the contributors:

Download

BootstrapValidator v0.4.2 Released

New features

Improvements

Bug fixes

  • #178: Do not validate fields that enabled is set to false, thanks to @henningda

Document

  • #169: Better to say: {validatorname} and {validatoroption} must be lowercase, thanks to @tomByrer

Contributors

Thank to the contributors:

Download

BootstrapValidator v0.4.1 Released

From this version, the plugin is available on jQuery plugins site.

Improvements

  • #106: Prevent the validate() method from submit the form automatically. So we can call validate() method to validate the form
  • #131: Doesn't trigger validation on the first focus
  • #145: The row state is now only marked as success if all fields on it are valid
  • #157: Added support for element outside of form using the selector option
  • #159, #163: User doesn't need to submit the form twice when remote validator complete, thanks to @jswale
  • #166, #167: The phone validator now also checks the length of US phone number, thanks to @gercheq

Bug fixes

Contributors

Thank to the contributors:

Download

BootstrapValidator v0.4.0 Released

New features

HTML 5 attribute Equivalent validator Equivalent HTML attribute
min="..." greaterThan validator
data-bv-greaterthan="true"
data-bv-greaterthan-value="..."
max="..." lessThan validator
data-bv-lessthan="true"
data-bv-lessthan-value="..."
maxlength="..." stringLength validator
data-bv-stringlength="true"
data-bv-stringlength-max="..."
pattern="..." regexp validator
data-bv-regexp="true"
data-bv-regexp-regexp="..."
required notEmpty validator data-bv-notempty="true"
type="color" hexColor validator data-bv-hexcolor="true"
type="email" emailAddress validator data-bv-emailaddress="true"
type="range"
min="..."
max="..."
between validator
data-bv-between="true"
data-bv-between-min="..."
data-bv-between-max="..."
type="url" uri validator data-bv-uri="true"

Changes

Improvements

  • #133: The regexp validator allows to pass a string
  • #136: Support multiple elements with the same name
  • #140: Do not validate hidden (type="hidden") and invisible element, thanks to @easonhan007

Bug fixes

  • #126: Submit button remains disabled after calling custom submitHandler and the form is valid
  • #132: The fields.[fieldName].message option is not used when showing the error message

Contributors

Thank to the contributors:

Download

BootstrapValidator v0.3.3 Released

Improvements

  • #50: Don't validate disabled element
  • #120: Handle case where a field is removed after the bootstrap validation, thanks to @patmoore

Bug fixes

Contributors

Thank to the contributor:

Download

BootstrapValidator v0.3.2 Released

New features

Improvements

Contributors

Thank to the contributor:

Download

BootstrapValidator v0.3.1 Released

New features

Changes

  • Remove the columns option. Now the plugin works normally no matter how many columns the form uses

Improvements

  • #3, #92: Support more form controls on the same row
  • #72, #79: Improve updateStatus() method to make the plugin play well with another
  • #102: The resetForm method now only resets fields with validator rules

Bug fixes

  • #82, #84: The error messages aren't shown if the form field doesn't have label
  • #89: submitHandler or default submission isn't called after remote validation completes

Contributors

Thank to the contributors:

Download

BootstrapValidator v0.3.0 Released

New features

Improvements

Bug fixes

Contributors

Thank to the contributors:

Download

BootstrapValidator v0.2.2 Released

Improvements

  • #15: Focus to the first invalid element
  • #31: remote validator: Allow to set additional data to remote URL
  • #32, #43, #47: Only validate not empty field
  • #39: Validate existing fields only

Bug fixes

  • #34: Avoid from calling form submit recursively
  • #40: Fix the issue when the form label doesn't have class

Download

BootstrapValidator v0.2.1 Released

Improvements

  • #29: Upgrade Bootstrap to v3.0.2
  • #30: Hide the error block containers before validating

Download

BootstrapValidator v0.2.0 Released

New features

Improvements

  • #22: Support form that labels are placed in extra small (col-xs-), small (col-sm-), medium (col-md-) elements

Bug fixes

Download

BootstrapValidator v0.1.1 Released

New features

Improvements

  • #16: Added disabling client side validation in HTML 5
  • #17: Added support for default Bootstrap form without labels
  • #19: Added support for select box validator

Download