function ValidateForm12(){ 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.ContactForm12.field114.value.length==0){ flag = false; } if (document.ContactForm12.field115.value.length==0){ flag = false; } if (document.ContactForm12.field116.value.length==0){ flag = false; } if (document.ContactForm12.field117.value.length==0){ flag = false; } if (document.ContactForm12.field118.value.length==0){ flag = false; } if (document.ContactForm12.field119.value.length==0){ flag = false; } if (document.ContactForm12.field122.value.length==0){ flag = false; } if (!document.ContactForm12.field115.value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)) { flag = false; message += '\n"Email" is invalid!'; } if (!document.ContactForm12.field116.value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)) { flag = false; message += '\n"Confirm Email" is invalid!'; } if (flag == false) { alert(message); } else { document.ContactForm12.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 ValidateResult12() { if(http.readyState == 4) { ValidateForm12(); } } function CheckForm12() { var captchacheck = document.ContactForm12.captchacode.value; var captchasalt = document.ContactForm12.captchacodesalt.value; var url = '/php-contacts/captcha-process.php?captcha=' + captchacheck + '&captchasalt=' + captchasalt; http.open('GET', url, true); http.onreadystatechange = ValidateResult12; http.send(null); }