$(document).ready(function(){ $('#feedback_button').click(function() { //alert("222"); var feedback_mes = $("#feedback_mes").val(); var feedback_name = $("#feedback_name").val() + " (" + $("#feedback_company").val() + ")"; var feedback_phone = $("#feedback_phone").val(); var feedback_email = $("#feedback_email").val(); var validator = 1; //валидация if (feedback_mes.length < 3) { $('#feedback_mes').css({'border':'red 1px solid','box-shadow':'red 0px 0px 4px 0px inset', 'height' : '22px', 'width' : '230px'}); validator = 0; } if ((feedback_name.length < 3)||(feedback_name == $("#feedback_name").attr("title"))) { $('#feedback_name').css({'border':'red 1px solid','box-shadow':'red 0px 0px 4px 0px inset', 'height' : '22px', 'width' : '230px'}); validator = 0; } /* if ((feedback_phone.length < 3)||(feedback_phone == $("#feedback_phone").attr("title"))) { $('#feedback_phone').css({'border':'red 1px solid','box-shadow':'red 0px 0px 4px 0px inset', 'height' : '22px', 'width' : '230px'}); validator = 0; } */ if ((feedback_email.length < 3)||(feedback_email == $("#feedback_email").attr("title"))) { $('#feedback_email').css({'border':'red 1px solid','box-shadow':'red 0px 0px 4px 0px inset', 'height' : '22px', 'width' : '230px'}); validator = 0; } var reEmail = new RegExp('^[a-z0-9\._-]+@[a-z0-9][a-z0-9_-]*(\.[a-z0-9_-]+)*'+ '\.([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|'+ 'int|mil|museum|name|net|org|pro|travel)$', 'i'); if (!reEmail.test(feedback_email)) { $('#feedback_email').css({'border':'red 1px solid','box-shadow':'red 0px 0px 4px 0px inset', 'height' : '22px', 'width' : '230px'}); validator = 0; } if ( validator == 0 ) { return false; } $("#feedback").html("