Created
October 14, 2016 16:09
-
-
Save felipeorlando/65d3d73667fe87a3bcdd93048ea21ce3 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
;(function() { | |
var submitContact = function() { | |
$.ajax({ | |
url: '/contato', | |
method: 'POST', | |
dataType: 'JSON', | |
data: $('#form').serialize(), | |
success: function(data) { | |
if (data) { | |
$('.msg-success').show(); | |
$('form').find('input.validate').val(''); | |
} else { | |
$('.msg-error').show(); | |
} | |
} | |
}); | |
}; | |
$(document) | |
.on('submit', '#form', submitContact) | |
; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment