/* VALIDATION CODE This code needs to be left into your contest to work properly. You may carefully edit lines below as needed. Please review comments on changing various options to make your contest work more to your specific needs. */ var form_id='204' /* if you want form validation page load also count as visit, comment out follow if statement */ if(document.URL.indexOf('invalid=')0){ err+=checkValue(f.q6,'/[A-Za-z]{2}/','UNIT'); } err+=checkValue(f.q7,'','PROVINCE'); err+=checkValue(f.q8,'/[A-Z][0-9][A-Z]/i','POSTAL_CODE1'); err+=checkValue(f.q9,'/[0-9][A-Z][0-9]/i','POSTAL_CODE2'); err+=checkValue(f.q10,'/^[0-9]{3}$/','HOME_PHONE1'); err+=checkValue(f.q11,'/^[0-9]{3}$/','HOME_PHONE2'); err+=checkValue(f.q12,'/^[0-9]{4}$/','HOME_PHONE3'); err+=checkValue(f.q16,'re_email','EMAIL_ADDRESS'); f.q21.value=document.referrer; f.q23.value=document.URL; // to enable user entry email and postal code check, uncomment next three lines: // var postal=''; // postal+=getEv('POSTAL_CODE1'); // postal+=getEv('POSTAL_CODE2'); var fromEmail=getEv('EMAIL_ADDRESS'); if(err==''){ var sender=fromEmail.replace(/W/g,'_')+'_'+form_id; // to enable user entry email and postal code check, uncomment next line, comment out the line after: // if(document.URL.indexOf('invalid=captcha')<0 && getCookie(sender+postal)==form_id){ if(document.URL.indexOf('invalid=captcha')<0 && getCookie(sender)==form_id){ var el=getEl('form'+form_id); // Change the following line to document.location = '/path/xxx.html' to have this go to it's own page. el.innerHTML = 'Sorry - you have already entered this contest and cannot submit another entry.'; return false; } else { if(f.emails != undefined && f.emails.value.indexOf('@')-1){ var y=document.createElement('div') y.innerHTML=err.replace(/n/gi,'') alert(y.innerHTML.replace(//gi,'n')) } else { alert(err) } return false; } }