This commit is contained in:
danogentili 2016-02-17 14:05:07 +01:00
parent b6662b1de3
commit e45a2c350f
2 changed files with 6 additions and 4 deletions

View File

@ -86,7 +86,7 @@
<!-- Contact Form JavaScript --> <!-- Contact Form JavaScript -->
<script src="js/jqBootstrapValidation.js"></script> <script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact_me.js?v=4"></script> <script src="js/contact_me.js?v=5"></script>
<!-- Custom Theme JavaScript --> <!-- Custom Theme JavaScript -->
<script src="js/freelancer.js"></script> <script src="js/freelancer.js"></script>

View File

@ -1,6 +1,6 @@
$(function() { $(function() {
$("input,textarea").jqBootstrapValidation({ $("#contactForm input,#contactForm textarea").jqBootstrapValidation({
preventSubmit: true, preventSubmit: true,
submitError: function($form, event, errors) { submitError: function($form, event, errors) {
// additional error messages or events // additional error messages or events
@ -30,9 +30,10 @@ $(function() {
email: email, email: email,
message: message, message: message,
domain: domain domain: domain
}, },
cache: false, cache: false,
success: function(data) {
$("#btnSubmit").attr("disabled", false);
if(data == "ok") { if(data == "ok") {
// Success message // Success message
$('#success').html("<div class='alert alert-success'>"); $('#success').html("<div class='alert alert-success'>");
@ -56,6 +57,7 @@ $(function() {
} }
}, },
error: function() { error: function() {
$("#btnSubmit").attr("disabled", false);
// Fail message // Fail message
$('#success').html("<div class='alert alert-danger'>"); $('#success').html("<div class='alert alert-danger'>");
$('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;") $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")