Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('#contact-form').on('submit', function(e) {
- e.preventDefault();
- var name = $('#name').val();
- var email = $('#email').val();
- var phone = $('#phone').val();
- var address = $('#address').val();
- var subject = $('#subject').val();
- var message = $('#message').val();
- //pretend we don't need validation
- //send to formspree
- $.ajax({
- url:'contactform/send_email.php',
- method:'POST',
- data:{
- Name: name,
- Email: email,
- Phone: phone,
- Address: address,
- Subject: subject,
- Message: message,
- },
- dataType:"html",
- success:function() {
- console.log('success');
- //$('#contact-form').hide();
- $('#sendmessage').show();
- $('#contact-form').trigger('reset');
- //$('#contact-form').show();
- setTimeout(function () {
- $('#sendmessage').hide();
- //window.location.reload();
- }, 2000);
- },
- error:function() {
- console.log(name);
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement