Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

bootstrap 4 form validator with jquery

$(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
  })
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bootstrap #form #validator #jquery
ADD COMMENT
Topic
Name
9+5 =