diff --git a/index.html b/index.html index 153cf50..8c6deef 100644 --- a/index.html +++ b/index.html @@ -86,7 +86,7 @@ - + diff --git a/js/contact_me.js b/js/contact_me.js index 265e33c..be72b7d 100644 --- a/js/contact_me.js +++ b/js/contact_me.js @@ -1,6 +1,6 @@ $(function() { - $("input,textarea").jqBootstrapValidation({ + $("#contactForm input,#contactForm textarea").jqBootstrapValidation({ preventSubmit: true, submitError: function($form, event, errors) { // additional error messages or events @@ -9,7 +9,7 @@ $(function() { // Prevent spam click and default submit behaviour $("#btnSubmit").attr("disabled", true); event.preventDefault(); - + // get values from FORM var name = $("input#name").val(); var email = $("input#email").val(); @@ -30,9 +30,10 @@ $(function() { email: email, message: message, domain: domain - }, cache: false, + success: function(data) { + $("#btnSubmit").attr("disabled", false); if(data == "ok") { // Success message $('#success').html("