function ValidateForm2(){ var flag = true; var message = 'Please fill in all mandatory fields !'; if(http.readyState == 4) { var showcheck = http.responseText; if (showcheck=='0') { message = 'Incorrect verification code!'; flag = false; }; if (document.ContactForm2.field9.value.length==0){ flag = false; }; if (document.ContactForm2.field10.value.length==0){ flag = false; }; if (document.ContactForm2.field14.value.length==0){ flag = false; }; if (document.ContactForm2.field15.value.length==0){ flag = false; }; if (document.ContactForm2.field16.value.length==0){ flag = false; }; if (document.ContactForm2.field17.value.length==0){ flag = false; }; if (document.ContactForm2.field18.value.length==0){ flag = false; }; if (document.ContactForm2.field19.value.length==0){ flag = false; }; if (flag == false) { alert(message); } else { document.ContactForm2.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 CheckForm2() { var captchacheck = document.ContactForm2.captchacode.value; var url = '/formscript/captcha-process.php?captcha=' + captchacheck; http.open('GET', url, true); http.onreadystatechange = ValidateForm2; http.send(null); };