function ValidateForm2(){ var flag = true; var message = 'Please fill in all mandatory fields !'; var showcheck = -1; if (showcheck=='0') { message = 'Incorrect verification code!'; flag = false; } if (document.ContactForm2.field1.value.length==0){ flag = false; } if (document.ContactForm2.field2.value.length==0){ flag = false; } if (document.ContactForm2.field3.value.length==0){ flag = false; } if (document.ContactForm2.field28.value.length==0){ flag = false; } if (document.ContactForm2.field5.value.length==0){ flag = false; } if (document.ContactForm2.field13.value.length==0){ flag = false; } if (document.ContactForm2.field7.value.length==0){ flag = false; } if (document.ContactForm2.field10.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 ValidateResult2() { if(http.readyState == 4) { ValidateForm2(); } } function CheckForm2() { ValidateForm2(); }