function ValidateForm3(){ var flag = true; var message = 'Please fill in all mandatory fields !'; var showcheck = -1;var showcheck = http.responseText; if (showcheck=='0') { message = 'Incorrect verification code!'; flag = false; } if (document.ContactForm3.field29.value.length==0){ flag = false; } if (document.ContactForm3.field30.value.length==0){ flag = false; } if (document.ContactForm3.field31.value.length==0){ flag = false; } if (document.ContactForm3.field32.value.length==0){ flag = false; } if (document.ContactForm3.field33.value.length==0){ flag = false; } if (document.ContactForm3.field34.value.length==0){ flag = false; } if (document.ContactForm3.field35.value.length==0){ flag = false; } if (document.ContactForm3.field36.value.length==0){ flag = false; } if (document.ContactForm3.field38.value.length==0){ flag = false; } if (document.ContactForm3.field39.value.length==0){ flag = false; } if (document.ContactForm3.field40.value.length==0){ flag = false; } if (!document.ContactForm3.field38.value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)) { flag = false; message += '\n"Email" is invalid!'; } if (flag == false) { alert(message); } else { document.ContactForm3.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 ValidateResult3() { if(http.readyState == 4) { ValidateForm3(); } } function CheckForm3() { var captchacheck = document.ContactForm3.captchacode.value; var captchasalt = document.ContactForm3.captchacodesalt.value; var url = '/script/captcha-process.php?captcha=' + captchacheck + '&captchasalt=' + captchasalt; http.open('GET', url, true); http.onreadystatechange = ValidateResult3; http.send(null); }