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=="טלפון") { alert("נא למלא טלפון"); document.getElementById('phone').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('message').value=="" || document.getElementById('message').value=="הודעה") { alert("נא למלא הודעה"); document.getElementById('message').focus(); return false; } event.preventDefault(); var form = event.target; var g = form.querySelector('.recaptcha'); if (window.grecaptcha && g) { g.addEventListener('recaptcha_completed', function() { form.submit(); }); var submitBtn = form.querySelector('[type="submit"]'); if (submitBtn) { submitBtn.setAttribute('disabled', true); submitBtn.parentElement.classList.add('loading'); } grecaptcha.reset(g.dataset.widgetId); grecaptcha.execute(g.dataset.widgetId); } else { form.submit(); } } $(function() { $("#fullName").focus(function() { if($(this).attr("value") == 'שם מלא') $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'שם מלא'); }); $("#email").focus(function() { if($(this).attr("value") == 'דוא"ל') $(this).attr("value", '').css("direction", "ltr"); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'דוא"ל').css("direction", "rtl"); }); $("#phone").focus(function() { if($(this).attr("value") == 'טלפון') $(this).attr("value", '').css("direction", "ltr"); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'טלפון').css("direction", "rtl"); }); $("#cellPhone").focus(function() { if($(this).attr("value") == "אתר") $(this).attr("value", '').css("direction", "ltr"); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", "אתר").css("direction", "rtl"); }); $("#city1").focus(function() { if($(this).attr("value") == "YOUTUBE") $(this).attr("value", '').css("direction", "ltr"); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", "YOUTUBE").css("direction", "rtl"); }); $("#message").focus(function() { if($(this).attr("value") == 'הודעה') $(this).attr("value", ''); }).blur(function() { if($(this).attr("value") == '') $(this).attr("value", 'הודעה'); }); });