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"}); }); $(".call8-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 phone = $("input#phone").val(); if (phone == "") { $("label#phone_error").show(); $("input#phone").focus(); return false; } var content = $("textarea#content").val(); if (content == "") { $("label#content_error").show(); $("content#content").focus(); return false; } var dataString = 'yourname='+ yourname + '&phone=' + phone + '&content=' + content; //alert (dataString);return false; $.ajax({ type: "POST", url: "bin/process-callback.php", data: dataString, success: function() { $('#callback_form').html("
"); $('#callmessage').html("") .append("") .hide() .fadeIn(1000, function() { $('#callmessage').append("
Thank you!
Message has been sent!
"); }); } }); return false; }); }); })(jQuery);