//jQuery.noConflict(); (function($) { $(function() { $('.error').hide(); $('input.text-input').css({backgroundColor:"#FFFFFF"}); $('input.text-input').focus(function(){ $(this).css({backgroundColor:"#FFDDAA"}); }); $('input.text-input').blur(function(){ $(this).css({backgroundColor:"#FFFFFF"}); }); $(".wpcf7-submit").click(function() { // validate and process form // first hide any error messages $('.error').hide(); var yourname = $("input#yourname").val(); if (yourname == "") { $("label#yourname_error").show(); $("input#yourname").focus(); return false; } var email = $("input#email").val(); if (email == "") { $("label#email_error").show(); $("input#email").focus(); return false; } var phone = $("input#phone").val(); if (phone == "") { $("label#phone_error").show(); $("input#phone").focus(); return false; } var subject = $("input#subject").val(); var content = $("textarea#content").val(); if (content == "") { $("label#content_error").show(); $("textarea#content").focus(); return false; } if($('#gdpr').is(':checked')) { var dataString = 'yourname='+ yourname + '&email=' + email + '&phone=' + phone + '&subject=' + subject + '&content=' + content; //alert (dataString);return false; $.ajax({ type: "POST", url: "bin/process-contact.php", data: dataString, success: function() { $('#contact_form').html("
"); $('#message').html("") .append("") .hide() .fadeIn(1000, function() { $('#message').append("
Thank you! Message has been sent!
"); }); } }); return false; } //gdpr }); }); })(jQuery);