📜  带有 jquery 的 bootstrap 4 表单验证器 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:35.386000             🧑  作者: Mango

代码示例1
$(document).ready(function() {
  $("#submitButton").click(function() {
    //Fetch form to apply custom Bootstrap validation
    var form = $("#signup-form");

    if (form[0].checkValidity() === false) {
      event.preventDefault();
      event.stopPropagation();
    }
    
    form.addClass('was-validated');

    //Make ajax call here
  })
})