浏览代码

#244: Only enable the submit buttons if all fields are valid, thanks to @smeagol74

nghuuphuoc 11 年之前
父节点
当前提交
6d7e0e735b
共有 4 个文件被更改,包括 4 次插入2 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 0
      README.md
  3. 1 1
      dist/js/bootstrapValidator.js
  4. 1 1
      dist/js/bootstrapValidator.min.js

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@
 * [#211](https://github.com/nghuuphuoc/bootstrapvalidator/issues/211), [#235](https://github.com/nghuuphuoc/bootstrapvalidator/issues/235): Add new method ```getInvalidFields()``` that returns all invalid fields
 * [#275](https://github.com/nghuuphuoc/bootstrapvalidator/issues/275): Add ```destroy()``` method
 * [#297](https://github.com/nghuuphuoc/bootstrapvalidator/issues/297): Disable feedback icons for particular fields
+* [#244](https://github.com/nghuuphuoc/bootstrapvalidator/pull/244): Only enable the submit buttons if all fields are valid, thanks to [@smeagol74](https://github.com/smeagol74)
 * [#274](https://github.com/nghuuphuoc/bootstrapvalidator/pull/274): Fix feedback icons in ```input-group```, thanks to [@tiagofontella](https://github.com/tiagofontella)
 * [#282](https://github.com/nghuuphuoc/bootstrapvalidator/issues/282): Use error message that is returned from [```callback```](http://bootstrapvalidator.com/validators/callback/), [```remote```](http://bootstrapvalidator.com/validators/remote/) validators
 * [#287](https://github.com/nghuuphuoc/bootstrapvalidator/issues/287): Only send the submit button which is clicked. It's an enhancement for [#238](https://github.com/nghuuphuoc/bootstrapvalidator/issues/238)

+ 1 - 0
README.md

@@ -112,6 +112,7 @@ Big thanks to the contributors:
 * [@lloydde](https://github.com/lloydde)
 * [@narutosanjiv](https://github.com/narutosanjiv)
 * [@patmoore](https://github.com/patmoore)
+* [@smeagol74](https://github.com/smeagol74)
 * [@tiagofontella](https://github.com/tiagofontella)
 * [@tomByrer](https://github.com/tomByrer)
 * [@vaz](https://github.com/vaz)

+ 1 - 1
dist/js/bootstrapValidator.js

@@ -794,7 +794,7 @@
                                         var v = $(this).attr('data-bv-validator');
                                         return $field.data('bv.result.' + v) != that.STATUS_VALID;
                                     }).length == 0;
-                    this.disableSubmitButtons(!isValidField);
+                    this.disableSubmitButtons(this.isValid() ? false : true);
                     if ($icon) {
                         $icon
                             .removeClass(this.options.feedbackIcons.invalid).removeClass(this.options.feedbackIcons.validating).removeClass(this.options.feedbackIcons.valid)

文件差异内容过多而无法显示
+ 1 - 1
dist/js/bootstrapValidator.min.js