Created
May 22, 2015 14:11
-
-
Save Korveld/6cd4e80cb6d06252de72 to your computer and use it in GitHub Desktop.
Ajax form js
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
| $(document).ready(function() { | |
| $('#form').submit(function() { | |
| $.ajax({ | |
| type: 'POST', | |
| url: 'mail.php', | |
| data: $(this).serialize() | |
| }).done(function() { | |
| $(this).find('input').val(''); | |
| alert('Спасибо за заявку! Скоро мы с вами свяжемся.'); | |
| $('#form').trigger('reset'); | |
| }); | |
| return false; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment