$(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"}); }); $("#yolla").click(function() { // validate and process form // first hide any error messages $('.error').hide(); var firma = encodeURIComponent($("input#firma").val().replace(/%/g,"xXxYUZDExXx")); var yetkili = encodeURIComponent($("input#yetkili").val().replace(/%/g,"xXxYUZDExXx")); var eposta = encodeURIComponent($("input#eposta").val().replace(/%/g,"xXxYUZDExXx")); var telefon = encodeURIComponent($("input#telefon").val().replace(/%/g,"xXxYUZDExXx")); var detay = encodeURIComponent($("textarea#detay").val().replace(/%/g,"xXxYUZDExXx").replace(/\n/g,"
")); if (yetkili == "") { $("div#yetkili_error").show(); $("input#yetkili").focus(); return false; } if (eposta == "" && telefon == "" ) { $("div#eposta_error").show(); $("div#telefon_error").show(); $("input#eposta").focus(); return false; } if (detay == "" ) { alert('Lütfen projenizle ilgili kısa detaylar veriniz.'); $("textarea#detay").focus(); return false; } var dataString = 'firma='+ firma + '&yetkili=' + yetkili + '&eposta=' + eposta + '&telefon=' + telefon + '&detay=' + detay; //alert (dataString);return false; $.ajax({ type: "POST", url: "form-gonder.php", contentType : "application/x-www-form-urlencoded; charset=utf-8", data: dataString, success: function() { $('#stylized').html("
"); $('#message').html("

Teşekkürler! Formunuz başarıyla elimize ulaştı.

") .append("

Ekibimiz en kısa sürede sizinle irtibata geçecektir.

") .hide() .fadeIn(1500, function() { $('#message').append(""); }); } }); return false; }); }); runOnLoad(function(){ $("input#name").select().focus(); });