function ValidateForm1(){ var flag = true; var message = 'Gelieve alle verplichten velden in te vullen'; if(http.readyState == 4) { var showcheck = http.responseText; if (showcheck=='0') { message = 'Onjuste verificatie code'; flag = false; }; if (document.ContactForm1.field1.value.length==0){ flag = false; }; if (document.ContactForm1.field2.value.length==0){ flag = false; }; if (document.ContactForm1.field3.value.length==0){ flag = false; }; if (flag == false) { alert(message); } else { document.ContactForm1.submit(); }; }; };function createRequestObject(){ try { xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert('Sorry, je brouser ondersteunt geen XML Http Request.'); }; return xmlhttp; }; var http = createRequestObject(); function CheckForm1() { var captchacheck = document.ContactForm1.captchacode.value; var url = '/formphp/captcha-uitvoer.php?captcha=' + captchacheck; http.open('GET', url, true); http.onreadystatechange = ValidateForm1; http.send(null); };