bootstrap验证器的成功功能不起作用?

时间:2018-05-29 02:03:54

标签: javascript jquery html twitter-bootstrap-3

我的表单验证工作正常,但最终没有触发成功功能。语法似乎很好。但我不确定我们是否可以使用验证器

包含成功函数

但是,防止默认不会阻止它提交。任何帮助???

$('#editVolForm').bootstrapValidator({

  // To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
  feedbackIcons: {
    valid: 'glyphicon glyphicon-ok',
    invalid: 'glyphicon glyphicon-remove',
    validating: 'glyphicon glyphicon-refresh'
  },

  editPapSub: {
    validators: {
      stringLength: {
        min: 1,
      },
      regexp: {
        regexp: /^[0-9]+$/,
        message: "'Submitted Papers' can only consist of numeric characters."
      },
      notEmpty: {
        message: "A valid number of 'Papers Submmited' is required."
      }
    }
  },
  editPapAcc: {
    validators: {
      stringLength: {
        min: 1,
      },
      regexp: {
        regexp: /^[0-9]+$/,
        message: "'Accepted Papers' can only consist of numeric characters."
      },
      notEmpty: {
        message: "A valid number of 'Papers Accepted' is required."
      }
    }



  }
}).on('success.form.bv', function(e) {

  e.preventDefault();
  console.log("test");
});

0 个答案:

没有答案