Browse Source

#244: Fix the case the submit button is not clicked

nghuuphuoc 11 years ago
parent
commit
fa035f79ad

+ 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(this.isValid() ? false : true);
+                    this.disableSubmitButtons(this.$submitButton ? !this.isValid() : !isValidField);
                     if ($icon) {
                         $icon
                             .removeClass(this.options.feedbackIcons.invalid).removeClass(this.options.feedbackIcons.validating).removeClass(this.options.feedbackIcons.valid)

File diff suppressed because it is too large
+ 1 - 1
dist/js/bootstrapValidator.min.js


+ 1 - 1
src/js/bootstrapValidator.js

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