Skip to content Skip to sidebar Skip to footer

Only Show Modal Box If The Form Fields Are Valid And Filled In - JQuery

I have a two field form that once the user clicks submit a modal pops up and they have to accept some terms to complete the registration process. However my two field form has requ

Solution 1:

Instead of bind your function to the button click, use the form submit event. Like that:

  $(document).ready(function () {
    $("#login-form").submit(function (e) {
        e.preventDefault();
        $(".modal").addClass("active");
    });
  });

Post a Comment for "Only Show Modal Box If The Form Fields Are Valid And Filled In - JQuery"