M
M
Mikhail Vlasov2015-10-30 20:25:23
JavaScript
Mikhail Vlasov, 2015-10-30 20:25:23

How do I set up a form submission notification?

Hello. There is a working form with alert, I wanted to display my div instead

$("#form").submit(function() {
    $.ajax({
      type: "POST",
      url: "mail.php",
      data: $(this).serialize()
    }).done(function() {
      $(this).find("input").val("");
      alert("Спасибо за заявку! Скоро мы с вами свяжемся.");
      $("#form").trigger("reset");
    });
    return false;
  });

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question