/
form.js
30 lines (27 loc) · 956 Bytes
/
form.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$(function() {
$("#contact_form").submit(function(e) {
e.preventDefault();
// if (! $("[name='_replyto']").val())
// {
// alert("Your email is mandatory if you want me to get in touch!");
// $("#your_email").css("border", "1px solid #ff0000");
// return;
// }
// if (! $("[name='message']").val())
// {
// alert("Tell me about the purpose of your message and how I can help you!");
// $("#your_message").css("border", "1px solid #ff0000");
// return;
// }
$.ajax({
url: "//formspree.io/thibaut@lelevier.fr",
method: "POST",
data: $(this).serialize(),
dataType: "json",
success: function(data){
$('#contact-content').empty();
$('#contact-content').html("<h3>Merci</h3><p>Votre demande a bien été envoyé et nous reviendrons vers vous dès que possible.</p>");
}
});
});
});