function ValidateForm207(){ var flag = true; var message = 'Controlla tutti i campi Obbligatori !'; var showcheck = -1;var showcheck = http.responseText; if (showcheck=='0') { message = 'Codice Captcha non corretto, Riprova!'; flag = false; } if (document.ContactForm207.field1820.value.length==0){ flag = false; } if (document.ContactForm207.field1821.value.length==0){ flag = false; } if (document.ContactForm207.field1822.value.length==0){ flag = false; } if (document.ContactForm207.field1824.value.length==0){ flag = false; } if (document.ContactForm207.field1825.checked==false){ flag = false; } if (!document.ContactForm207.field1822.value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)) { flag = false; message += '\n"Email" non è corretta!'; } if (flag == false) { alert(message); } else { document.ContactForm207.submit(); } }function createRequestObject(){ try { xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert('Sorry, but your browser doesn\'t support XMLHttpRequest.'); } return xmlhttp; } var http = createRequestObject(); function ValidateResult207() { if(http.readyState == 4) { ValidateForm207(); } } function CheckForm207() { var captchacheck = document.ContactForm207.captchacode.value; var captchasalt = document.ContactForm207.captchacodesalt.value; var url = '/contactform17/captcha-process.php?captcha=' + captchacheck + '&captchasalt=' + captchasalt; http.open('GET', url, true); http.onreadystatechange = ValidateResult207; http.send(null); }