Created
February 9, 2018 15:43
-
-
Save AntoninMarchardDev/3c93080160b6b502f3c13e8717567608 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('#sending_form').click(function(e){ | |
| e.preventDefault(); | |
| var data = { | |
| email: $('#email').val(), | |
| name: $('#name').val(), | |
| objet: $('#object').val(), | |
| message: $('#message').val() | |
| }; | |
| $.ajax({ | |
| url: "get_mail.php", | |
| type: 'POST', | |
| data: data, | |
| success: function(data) { | |
| $('#js_alert_success').css({'display' : 'block'}); | |
| setTimeout(function(){ | |
| $('#js_alert_success').css({'display' : 'none'}); | |
| $('#email').val(""); | |
| $('#name').val(""); | |
| $('#object').val(""); | |
| $('#message').val("") | |
| }, 3000); | |
| }, | |
| error: function(data) { | |
| $('#js_alert_danger').css({'display' : 'block'}); | |
| setTimeout(function(){ | |
| $('#js_alert_danger').css({'display' : 'none'}); | |
| $('#email').val(""); | |
| $('#name').val(""); | |
| $('#object').val(""); | |
| $('#message').val("") | |
| }, 3000); | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
J'envie de développer mes compétences