// content contact form $(function () { $('.error').hide(); $('.text-input').css({backgroundcolor:"#ffffff"}); $('.text-input').focus(function () { $(this).css({backgroundcolor:"#fcfcfc"}); }); $('.text-input').blur(function () { $(this).css({backgroundcolor:"#ffffff"}); }); $(".form-button").click(function () { // validate and process form // first hide any error messages $('.error').hide(); var name = $("input#name").val(); if (name == "") { $("label#name_error").show(); $("input#name").focus(); return false; } var email = $("input#email").val(); var filter = /^[a-za-z0-9]+[a-za-z0-9_.-]+[a-za-z0-9_-]+@[a-za-z0-9]+[a-za-z0-9.-]+[a-za-z0-9]+.[a-z]{2,4}$/; console.log(filter.test(email)); if (!filter.test(email)) { $("label#email_error").show(); $("input#email").focus(); return false; } var message = $("#input-message").val(); if (message == "") { $("label#message_error").show(); $("#input-message").focus(); return false; } var datastring = 'name=' + name + '&email=' + email + '&message=' + message; //alert (datastring);return false; $.ajax({ type:"post", url:"process.php", data:datastring, success:function () { $('#af-form').prepend("