bootstrap-validator icon indicating copy to clipboard operation
bootstrap-validator copied to clipboard

Disabled buttons can still be clicked

Open flightsurvey opened this issue 8 years ago • 3 comments

When the OK button is disabled because validation tests have failed it shows as disabled but can still be clicked on.

flightsurvey avatar Nov 24 '17 19:11 flightsurvey

@flightsurvey add this code to validator.js

Line 294:

   Validator.prototype.toggleSubmit = function () {
    if (!this.options.disable) return
    this.$btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
    // add this line
    this.$btn.attr('disabled', this.isIncomplete() || this.hasErrors())
  }

Line 327:

   this.$btn.removeClass('disabled')
  // and this
   this.$btn.prop('disabled', false) 

bertonbeil avatar Dec 15 '17 02:12 bertonbeil

This needs a PR! Been banging my head against the wall for an hour trying to understand this.

utdrmac avatar Mar 26 '18 23:03 utdrmac

Adding this to the validator.js works well for me but the div below disappear <div class="help-block with-errors"></div>

peter450 avatar Jul 19 '18 12:07 peter450