function ValidateForm9(){ 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.ContactForm9.field86.value.length==0){ flag = false; } if (document.ContactForm9.field87.value.length==0){ flag = false; } if (document.ContactForm9.field88.value.length==0){ flag = false; } if (document.ContactForm9.field89.value.length==0){ flag = false; } if (document.ContactForm9.field90.value.length==0){ flag = false; } if (document.ContactForm9.field91.value.length==0){ flag = false; } if (document.ContactForm9.field94.value.length==0){ flag = false; } if (!document.ContactForm9.field87.value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)) { flag = false; message += '\n"Email" is invalid!'; } if (!document.ContactForm9.field88.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.ContactForm9.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 ValidateResult9() { if(http.readyState == 4) { ValidateForm9(); } } function CheckForm9() { var captchacheck = document.ContactForm9.captchacode.value; var captchasalt = document.ContactForm9.captchacodesalt.value; var url = '/php-contacts/captcha-process.php?captcha=' + captchacheck + '&captchasalt=' + captchasalt; http.open('GET', url, true); http.onreadystatechange = ValidateResult9; http.send(null); }