Hi,
We're looking to implement a captcha code to our web to lead form however we are struggling to implement the captcha code correctly. On the face of it, the captcha is implemented, however when you type the code generated into the free form field, it tells me it is incorrect. This is however wrong as it seems to be entered correctly.
It sometimes works on the second time, but that is intermittent.
Any help would be great as we're now a little stuck as to what to do next.
Code snippet below;
<META HTTP-EQUIV ='content-type' CONTENT='text/html;charset=UTF-8'>
<form action='
https://crm.zoho.com/crm/WebToLeadForm' name=WebToLeads833390000000065001 method='POST' onSubmit='javascript:document.charset="UTF-8"; return checkMandatory833390000000065001()' accept-charset='UTF-8'>
<!-- Do not remove this code. -->
<input type='text' style='display:none;' name='xnQsjsdp' value='8ea82c00b3360f2b1e5c57b16235ae7bccc31d7de97e2515d2822216586e9ea9'/>
<input type='hidden' name='zc_gad' id='zc_gad' value=''/>
<input type='text' style='display:none;' name='xmIwtLD' value='7c85ae857092149583d587953e20fadf8ddabb45c1504e45f2706fc7de7cf9c1'/>
<input type='text' style='display:none;' name='actionType' value='TGVhZHM='/>
<?php if ( wp_get_post_parent_id( $post->ID ) == 80 ) : ?>
<input type='text' style='display:none;' name='returnURL' value='http://kingstoncabinets.com/thank-you/'/>
<?php else : ?>
<input type='text' style='display:none;' name='returnURL' value='http://kingstoncabinets.com/thank-you-radiators/'/>
<?php endif; ?>
<!-- Do not remove this code. -->
<table style="background-color: white; color: black; width: 100%;">
<tbody style="width: 100%;">
<tr>
<td>
<select name='Salutation'>
<option value='-None-'>Title</option>
<option value='Mr.'>Mr.</option>
<option value='Mrs.'>Mrs.</option>
<option value='Ms.'>Ms.</option>
<option value='Dr.'>Dr.</option>
<option value='Mr and Mrs'>Mr and Mrs</option>
<option value='Prof.'>Prof.</option>
</select>
</td>
</tr>
<tr>
<td>
<table style="width: 100%; margin-bottom: 0;">
<tbody>
<tr>
<td>
<input type='text' maxlength='40' placeholder='Forename *' name='First Name' />
</td>
</tr>
<tr>
<td>
<input type='text' maxlength='80' placeholder='Surname *' name='Last Name' />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<input type='text' maxlength='100' placeholder='Email *' name='Email' />
</td>
</tr>
<tr>
<td>
<table style="width: 100%; margin-bottom: 0;">
<tbody>
<tr>
<td>
<input type='text' maxlength='30' placeholder='Phone *' name='Phone' />
</td>
</tr>
<tr>
<td>
<input type='text' maxlength='30' placeholder='Postcode *' name='Zip Code' />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<select name='LEADCF17'>
<option selected value='-None-'>How did you find us</option>
<option value='Web Search'>Web Search</option>
<option value='Homes and Gardens'>Homes and Gardens</option>
<option value='Ideal Homes'>Ideal Homes</option>
<option value='HBR Show'>HBR Show</option>
<option value='Houzz'>Houzz</option>
<option value='Recommendation'>Recommendation</option>
<option value='Other'>Other</option>
</select>
</td>
</tr>
<tr>
<td>
<h6>I would like...</h6>
</td>
</tr>
<tr>
<td>
<ul style="list-style-type: none; margin-bottom: 0;">
<li><input type='checkbox' name='LEADCF104'/> a design visit </li>
<li><input type='checkbox' name='LEADCF109'/> a callback </li>
</ul>
<hr/>
</td>
</tr>
<tr>
<td>
<input type='checkbox' name='LEADCF103'/> I consent to you processing my personal data as detailed in
your <a href="<?php echo home_url( '/privacy-statement' ) ?>" target="_blank">Privacy Notice</a>
<hr/>
</td>
</tr>
<tr>
<td>
<h6>Enter the Captcha</h6>
</td>
</tr>
<tr>
<td>
<input type='text' style='width:250px;' maxlength='80' name='enterdigest' />
</td>
</tr>
<tr>
<!-- Do not remove this code. -->
<td>
<a href='javascript:;' onclick='reloadImg()'>Reload</a>
</td>
</tr>
<tr>
<td colspan='2' style="text-align: center; padding-top: 15px;" colspan="2">
<input class="button" type='submit' value='Submit' />
</td>
</tr>
</table>
<script>
var mndFileds=new Array('First Name','Salutation','Last Name','Phone','Email','LEADCF17','Zip Code');
var fldLangVal=new Array('First Name','Salutation','Last Name','Phone','Email','How did you find us','Post Code');
var name='';
var email='';
/* Do not remove this code. */
function reloadImg() {
if(document.getElementById('imgid').src.indexOf('&d') !== -1 ) {
document.getElementById('imgid').src=document.getElementById('imgid').src.substring(0,document.getElementById('imgid').src.indexOf('&d'))+'&d'+new Date().getTime();
} else {
document.getElementById('imgid').src = document.getElementById('imgid').src+'&d'+new Date().getTime();
}
}
function checkMandatory833390000000065001() {
for(i=0;i<mndFileds.length;i++) {
var fieldObj=document.forms['WebToLeads833390000000065001'][mndFileds[i]];
if(fieldObj) {
if (((fieldObj.value).replace(/^\s+|\s+$/g, '')).length==0) {
if(fieldObj.type =='file')
{
alert('Please select a file to upload.');
fieldObj.focus();
return false;
}
alert(fldLangVal[i] +' cannot be empty');
fieldObj.focus();
return false;
} else if(fieldObj.nodeName=='SELECT') {
if(fieldObj.options[fieldObj.selectedIndex].value=='-None-') {
alert(fldLangVal[i] +' cannot be none');
fieldObj.focus();
return false;
}
} else if(fieldObj.type =='checkbox'){
if(fieldObj.checked == false){
alert('Please accept '+fldLangVal[i]);
fieldObj.focus();
return false;
}
}
try {
if(fieldObj.name == 'Last Name') {
name = fieldObj.value;
}
} catch (e) {}
}
}
}
</script>
</form>
<!-- Do not remove this code. -->
<iframe name='captchaFrame' style='display:none;'></iframe>
</div>