function checkFormContact() { if(document.getElementById('fullName').value=="" || document.getElementById('fullName').value=="שם מלא") { alert("נא למלא שם מלא"); document.getElementById('fullName').focus(); return false; } if(document.getElementById('email').value=="" || document.getElementById('email').value=='דוא"ל') { alert('נא למלא דוא"ל'); document.getElementById('email').focus(); return false; } if(document.getElementById('email').value != '' && document.getElementById('email').value!='דוא"ל') { if(!checkEmail(document.getElementById('email').value)) { alert('כתובת דוא"ל אינה תקינה'); document.getElementById('email').focus(); return false; } } if(document.getElementById('phone').value!='' && document.getElementById('phone').value!="טלפון") { if(!checkPhone(document.getElementById('phone').value)) { alert("הטלפון אינו תקין"); document.getElementById('phone').focus(); return false; } } if(document.getElementById('cellPhone').value=="" || document.getElementById('cellPhone').value=="טלפון נייד") { alert("נא למלא טלפון נייד"); document.getElementById('cellPhone').focus(); return false; } if(document.getElementById('cellPhone').value!='' && document.getElementById('cellPhone').value!="טלפון נייד") { if(!checkPhone(document.getElementById('cellPhone').value)) { alert("הטלפון נייד אינו תקין"); document.getElementById('cellPhone').focus(); return false; } } if(document.getElementById('city').value=="" || document.getElementById('city').value=="עיר") { alert("נא למלא עיר"); document.getElementById('city').focus(); return false; } if(document.getElementById('topic').value==-1) { alert('נא לבחור נושא'); document.getElementById('topic').focus(); return false; } if(document.getElementById('message').value=="" || document.getElementById('message').value=="הודעה") { alert("נא למלא הודעה"); document.getElementById('message').focus(); return false; } if(document.getElementById('email_code').value=="") { alert("נא להקיש קוד שבתמונה"); document.getElementById('email_code').focus(); return false; } return true; } $(function() { $("#fullName").focus(function() { if($(this).attr("value") == 'שם מלא') $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'שם מלא'); }); $("#email").keypress(function() { $(this).attr("value", jQuery.trim($(this).attr("value"))); }); $("#email").focus(function() { if($(this).attr("value") == 'דוא"ל') $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'דוא"ל'); }); $("#phone").focus(function() { if($(this).attr("value") == 'טלפון') $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'טלפון'); }); $("#cellPhone").focus(function() { if($(this).attr("value") == "טלפון נייד") $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", "טלפון נייד"); }); $("#city").focus(function() { if($(this).attr("value") == "עיר") $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", "עיר"); }); $("#address").focus(function() { if($(this).attr("value") == "כתובת") $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", "כתובת"); }); $("#message").focus(function() { if($(this).attr("value") == 'הודעה') $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'הודעה'); }); });