Search code examples
javascriptjquerytwitter-bootstrap

BootstrapValidator turn off enabled and disabled the submit button when typing


How can always enable submit button when typing in BootstrapValidator?


Solution

  • To achieve your goal, follow this tutorial

      $('#alwaysEnableButtonForm')
          .bootstrapValidator({
              ...
          })
          .on('error.field.bv', function(e, data) {
              if (data.bv.getSubmitButton()) {
                  data.bv.disableSubmitButtons(false);
              }
          })
          .on('success.field.bv', function(e, data) {
              if (data.bv.getSubmitButton()) {
                  data.bv.disableSubmitButtons(false);
              }
          });