- #168: Add siren and siret validators, thanks to @jswale
- #171: The
phone
validator now supports +1 country code and area code for US phone number, thanks to @tomByrer
- #144, #158: Fixed an issue that the custom submit handler is not fired from the second time
- #106: Prevent the
validate()
method from submit the form automatically. So we can callvalidate()
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
- #162: Fix errors in IE 8, thanks to @adgrafik
- #166, #167: The
phone
validator now also checks the length of US phone number, thanks to @gercheq
- #14, #57: Set validator option by using HTML 5 attributes
Form attributes:
<form
data-bv-message="This value is not valid"
data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
data-bv-feedbackicons-validating="glyphicon glyphicon-refresh"
>
Field attributes:
<input type="text" class="form-control" name="username"
data-bv-message="The username is not valid"
data-bv-notempty data-bv-notempty-message="The username is required and cannot be empty"
data-bv-stringlength="true" data-bv-stringlength-min="6" data-bv-stringlength-max="30" data-bv-stringlength-message="The username must be more than 6 and less than 30 characters long"
data-bv-different="true" data-bv-different-field="password" data-bv-different-message="The username and password cannot be the same as each other"
data-bv-remote="true" data-bv-remote-url="remote.php" data-bv-remote-message="The username is not available"
/>
- Support HTML 5 input types:
HTML 5 attribute | Validator |
---|---|
min="..." |
greaterThan validator |
max="..." |
lessThan validator |
maxlength="..." |
stringLength validator |
pattern="..." |
regexp validator |
required |
notEmpty validator |
type="color" |
hexColor validator |
type="email" |
emailAddress validator |
type="range" |
between validator |
type="url" |
uri validator |
- #74, #103, #122: Set the custom trigger event
It's possible to use data-bv-trigger
attribute:
<form data-bv-trigger="keyup">
<input type="text" class="form-control" name="firstName" placeholder="First name"
data-bv-trigger="keyup" />
...
<input type="text" class="form-control" name="lastName" placeholder="First name"
data-bv-trigger="blur" />
</form>
or trigger
option:
$(form).bootstrapValidator({
trigger: 'blur', // Set for all fields
fields: {
firstName: {
trigger: 'keyup', // Custom for each field. Can be 'event1 event2 event3'
validators: {
...
}
},
lastName: {
trigger: 'blur',
validators: {
...
}
}
}
});
<div class="form-group">
<input class="form-control" type="text" name="surveyAnswer[]" />
</div>
<div class="form-group">
<input class="form-control" type="text" name="surveyAnswer[]" />
</div>
<div class="form-group">
<input class="form-control" type="text" name="surveyAnswer[]" />
</div>
- #109: Add
setLiveMode()
method to turn on/off the live validating mode - #114: Add
iban
validator for validating IBAN (International Bank Account Number) - #116: Add
uuid
validator, support UUID v3, v4, v5 - #128: Add
numeric
validator - #135: Add
integer
validator - #138: Add
hex
validator - #139: Add
stringCase
validator to check a string is lower or upper case - #137: Register the plugin with jQuery plugins site
- #133: The
regexp
validator allows to pass a string - #140: Do not validate hidden (
type="hidden"
) and invisible element, thanks to @easonhan007 disableSubmitButtons()
is now marked as a public API- The first parameter of
updateStatus()
method now accepts the field name only - #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
- #50: Don't validate disabled element
- #34, #105: Cannot call
form.submit()
insidesubmitHandler
- #77, #117: The
notEmpty
validator doesn't work on file input - #120: Handle case where a field is removed after the bootstrap validation, thanks to @patmoore
- #56: Add
selector
option for each field. The field can be defined by CSS validator instead of thename
attribute - #107: Add
container
option for each field to indicate where the error messages are shown - #5: Add
ip
validator. Support both IPv4 and IPv6 - #6: Add
isbn
validator, support both ISBN 10 and ISBN 13 - #7: Add
step
validator - #95: Add
mac
validator - #96: Add
base64
validator - #97: Add
cvv
validator - #99, #100: Add
phone
validator. Support US phone number only, thanks to @gercheq - #112:
creditCard
validator now validates both IIN ranges and length
- #4: Add
date
validator - #72, #79: Improve
updateStatus()
method to make the plugin play well with another - #80: Add
enabled
option andenableFieldValidators()
method to enable/disable all validators to given field - #90: Add
bower.json
file, thanks to @ikanedo - #3, #92: Support more form controls on the same row
- Remove the
columns
option. Now the plugin works normally no matter how many columns the form uses - #102: The
resetForm
method now only resets fields with validator rules - #82, #84: The error messages aren't shown if the form field doesn't have label
- #89:
submitHandler
or default submission isn't called afterremote
validation completes
- #44: Rewrite entirely using Deferred
- #26, #27, #67: Add
choice
validator, thanks to @emilchristensen - #31: The
remote
validator supports dynamic data - #36, #58: Add method to validate form manually
- #41: Disable submit button on successful form submit
- #42: Add submit button to
submitHandler()
parameter - #48: Add optional feedback icons
- #64: Support Danish zip code, thanks to @emilchristensen
- #65: Support Sweden zip code, thanks to @emilchristensen
- #70: Support custom grid columns
- #71: Show all errors
- #76: Add
resetForm()
method - #50: Don't validate disabled element
- #51: Submit after submit doesn't work
- #53, #54: Fix
notEmpty
validator for radios and checkboxes, thanks to @kristian-puccio - #55: The plugin doesn't validate other fields if the
remote
validator returnstrue
- #62: The
callback
validator passes wrong parameter, thanks to @iplus - #59: Add example for Rail field convention, thanks to @narutosanjiv
- #60: Update the installation guide, thanks to @vaz
- #73: Describe which version should be included in the Usage section
- #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
- #34: Avoid from calling form submit recursively
- #40: Fix the issue when the form label doesn't have class
- #24: Add
live
option - #20: Add custom submit handler using
submitHandler
option - #9: Add
creditCard
validator - #18: Add
different
validator - #21: Add
callback
validator - #22: Support form that labels are placed in extra small (
col-xs-
), small (col-sm-
), medium (col-md-
) elements - #25: The
regexp
validator does not work
- Added
submitButtons
option - #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