title: How to validate captcha within an online form
body: <p>My job is to create a form for a competition and collect the data.
  This data will be collected by a company that we use to send e-mails (think Mail chimp).
  This company (email vision through their online software "campaign commander") has generated the form below.
  as you can see it does not validate captcha.
  What code do I need to make it validate captcha without leaving the form?
  The site was developed in PHP.
  Thank you for your help.
  and God bless us.
  Julian P.</p>
  
  <pre><code>                &lt;html&gt;
                  &lt;head&gt;
                  &lt;title&gt;Webform&lt;/title&gt;
                  &lt;meta http-equiv="Content-Type" content="text/html;charset=UTF-8"&gt;
                  &lt;script language="javascript"&gt;
                  function isInteger(input,fieldName){
                  var i;
                  for(i=0;i&lt;input.value.length;i++){
                  var c=input.value.charAt(i);
                  if(((c&lt;'0')||(c&gt;'9'))){
                  alert('The number in '+fieldName+' is not valid.');
                  input.focus();
                  return false;
                  }}
                  return true;
                  }
                  var dtCh='/';
                  var minYear=1900;
                  var maxYear=2100;
                  function isValidInteger(s){
                  var i;
                  for(i=0;i&lt;s.length;i++){
                  var c=s.charAt(i);
                  if(((c&lt;'0')||(c&gt;'9'))) return false;
                  }
                  return true;
                  }
                  function stripCharsInBag(s,bag){
                  var i;
                  var returnString='';
                  for(i=0;i&lt;s.length;i++){
                  var c=s.charAt(i);
                  if(bag.indexOf(c)==-1) returnString+=c;
                  }
                  return returnString;
                  }
                  function daysInFebruary(year){
                  return(((year%4==0)&amp;&amp;((!(year % 100 == 0))||(year%400==0)))?29:28);
                  }
                  function DaysArray(n){
                  for(var i=1;i&lt;=n;i++){
                  this[i]=31;
                  if(i==4||i==6||i==9||i==11){this[i]=30;}
                  if(i==2){this[i]=29;}
                  }
                  return this;
                  }
                  function isDateOK(dtStr){
                  if(dtStr=='') return true;
                  var daysInMonth=DaysArray(12);
                  var pos1=dtStr.indexOf(dtCh);
                  var pos2=dtStr.indexOf(dtCh,pos1+1);
                  var strDay=dtStr.substring(0,pos1);
                  var strMonth=dtStr.substring(pos1+1,pos2);
                  var strYear=dtStr.substring(pos2+1);
                  strYr=strYear;
                  if(strDay.charAt(0)=='0'&amp;&amp;strDay.length&gt;1) strDay=strDay.substring(1);
                  if(strMonth.charAt(0)=='0'&amp;&amp;strMonth.length&gt;1) strMonth=strMonth.substring(1);
                  for(var i=1;i&lt;=3;i++){
                  if(strYr.charAt(0)=='0'&amp;&amp;strYr.length&gt;1) strYr=strYr.substring(1);
                  }
                  month=parseInt(strMonth);
                  day=parseInt(strDay);
                  year=parseInt(strYr);
                  if(pos1==-1||pos2==-1){
                  alert('The date format should be : dd/mm/yyyy.');
                  return false;
                  }
                  if(strMonth.length&lt;1||month&lt;1||month&gt;12){
                  alert('Please enter a valid month.');
                  return false;
                  }
                  if(strDay.length&lt;1||day&lt;1||day&gt;31||(month==2&amp;&amp;day&gt;daysInFebruary(year))||day&gt;daysInMonth[month]){
                  alert('Please enter a valid day.');
                  return false;
                  }
                  if(strYear.length!=4||year==0||year&lt;minYear||year&gt;maxYear){
                  alert('Please enter a valid 4 digit year between '+minYear+' and '+maxYear+'.');
                  return false;
                  }
                  if(dtStr.indexOf(dtCh,pos2+1)!=-1||isValidInteger(stripCharsInBag(dtStr,dtCh))==false){
                  alert('Please enter a valid date.');
                  return false;
                  }
                  return true;
                  }
                  function modifyDateFormat(dt){
                  var valuesTable=dt.value.split(dtCh);
                  dt.value=valuesTable[1]+dtCh+valuesTable[0]+dtCh+valuesTable[2];
                  }
                  function isEmail(emailAddress){
                  emailAddressValue=emailAddress.value.toLowerCase();
                  var countryTLDs=/^(ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$/;
                  var gTLDs=/^(aero|asia|biz|cat|com|coop|edu|geo|gov|info|int|jobs|mil|mobi|museum|name|net|org|post|pro|tel|travel)$/;
                  var basicAddress=/^(.+)@(.+)$/;
                  var specialChars='\\(\\)&gt;&lt;@,;:\\\\\\\"\\.\\[\\]';
                  var validChars='\[^\\s'+specialChars+'\]';
                  var validCharset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzöå0123456789\'-_.+';
                  var quotedUser='(\"[^\"]*\")';
                  var atom=validChars+'+';
                  var word='('+atom+'|'+quotedUser+')';
                  var validUser=new RegExp('^'+word+'(\.'+word+')*$');
                  var symDomain=new RegExp('^'+atom+'(\.'+atom+')*$');
                  var matchArray=emailAddressValue.match(basicAddress);
                  if(emailAddress.value==''||emailAddress==null){
                  return true;
                  }
                  if(matchArray==null){
                  alert('The Email address doesn\'t seem to be correct,\nplease check syntax.');
                  emailAddress.focus();
                  return false;
                  }else{
                  var user=matchArray[1];
                  var domain=matchArray[2];
                  for(i=0;i&lt;user.length;i++){
                  if(validCharset.indexOf(user.charAt(i))==-1){
                  alert('The Email address contains invalid characters,\nplease check the username.');
                  emailAddress.focus();
                  return false;
                  }
                  }
                  for(i=0;i&lt;domain.length;i++){
                  if(validCharset.indexOf(domain.charAt(i))==-1){
                  alert('The Email address contains invalid characters,\nplease check the domain.');
                  emailAddress.focus();
                  return false;
                  }
                  }
                  if(user.match(validUser)==null){
                  alert('The Email address doesn\'t seem to be correct,\nplease check the username.');
                  emailAddress.focus();
                  return false;
                  }
                  var atomPat=new RegExp('^'+atom+'$');
                  var domArr=domain.split('.');
                  var len=domArr.length;
                  for(i=0;i&lt;len;i++){
                  if(domArr[i].search(atomPat)==-1){
                  alert('The Email address doesn\'t seem to be correct,\nplease check the domain name.');
                  emailAddress.focus();
                  return false;
                  }
                  }
                  if((domArr[domArr.length-1].length==2)&amp;&amp;(domArr[domArr.length-1].search(countryTLDs)==-1)){
                  alert('The Email address doesn\'t seem to be correct,\nplease check domain suffix.');
                  emailAddress.focus();
                  return false;
                  }
                  if((domArr[domArr.length-1].length&gt;2)&amp;&amp;(domArr[domArr.length-1].search(gTLDs)==-1)){
                  alert('The Email address doesn\'t seem to be correct,\nplease check domain suffix.');
                  emailAddress.focus();
                  return false;
                  }
                  if((domArr[domArr.length-1].length&lt;2)||(domArr[domArr.length-1].length&gt;6)){
                  alert('The Email address doesn\'t seem to be correct,\nplease check domain suffix.');
                  emailAddress.focus();
                  return false;
                  }
                  if(len&lt;2){
                  alert('The Email address doesn\'t seem to be correct,\nplease check missing hostname.');
                  emailAddress.focus();
                  return false;
                  }
                  }
                  return true;
                  }
                  function mandatoryCheckBox(checkBox,fieldName){
                  var nbcheck=0;
                  if(checkBox.length==undefined){
                  if(checkBox.checked){ nbcheck++; }
                  }else{
                  for (counter=0;counter&lt;checkBox.length;counter++){
                  if(checkBox[counter].checked){ nbcheck++; }
                  }
                  }
                  if(nbcheck==0){
                  alert('Please select your '+fieldName+'.');
                  return false;
                  }
                  return true;
                  }
                  function mandatoryDropDown(dropDown,fieldName){
                  if(dropDown.options[dropDown.options.selectedIndex].value == ""){
                  alert('Please select your '+fieldName+'.');
                  dropDown.focus();
                  return false;
                  }
                  return true;
                  }
                  String.prototype.trim = function() { return this.replace(/^\s*(\b.*\b|)\s*$/, "$1");    }
                  function mandatoryText(input,fieldName){
                  if(input.value.trim()==''||input==null){
                  alert('Please enter your '+fieldName+'.');
                  input.focus();
                  return false;
                  } else {
                  return true;
                  }
                  }
                  function validForm(){
                  if(!mandatoryText(document.getElementById('FIRSTNAME_FIELD'), 'First name')) return;
                  if(!mandatoryText(document.getElementById('LASTNAME_FIELD'), 'Surname')) return;
                  if(!mandatoryText(document.getElementById('DATEOFBIRTH_FIELD'), 'Date of birth')) return;
                  if(!isDateOK(document.getElementById('DATEOFBIRTH_FIELD').value)) return;
                  if(!mandatoryText(document.getElementById('EMAIL_FIELD'), 'Email')) return;
                  if(!isEmail(document.getElementById('EMAIL_FIELD'))) return;
                  if(!mandatoryText(document.getElementById('EMVCELLPHONE_FIELD'), 'Mobile')) return;
                  if(!isInteger(document.getElementById('EMVCELLPHONE_FIELD'), 'Mobile')) return;
                  if(!mandatoryDropDown(document.getElementById('STORE_NAME_FIELD'), 'Nearest shop')) return;
                  if(!mandatoryCheckBox(document.getElementById('emvForm').OPTIN_FIELD, 'Opt in to marketing emails')) return;
                  if(document.getElementById('DATEOFBIRTH_FIELD').value!='') modifyDateFormat(document.getElementById('DATEOFBIRTH_FIELD'));
                  document.getElementById('emvForm').submit();
                  if(document.getElementById('DATEOFBIRTH_FIELD').value!='') modifyDateFormat(document.getElementById('DATEOFBIRTH_FIELD'));
                  }
                  &lt;/script&gt;
                  &lt;/head&gt;
                  &lt;body&gt;
                  &lt;form name="emvForm" id="emvForm" action="http://tre.emv3.com/D2UTF8" method="POST" target="_top"&gt;
                  &lt;input type="hidden" name="emv_tag" value="876020001C384269" /&gt;
                  &lt;input type="hidden" name="emv_ref" value="EdX7CqkdLe_d8SA9MOPQNCffL0p6Hq3D-jmueKEyWsbQKbo" /&gt;
                  &lt;table&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  First name
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="text" id="FIRSTNAME_FIELD" name="FIRSTNAME_FIELD" value="" size="30" maxlength="64"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  Surname
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="text" id="LASTNAME_FIELD" name="LASTNAME_FIELD" value="" size="30" maxlength="64"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  Date of birth
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="text" id="DATEOFBIRTH_FIELD" name="DATEOFBIRTH_FIELD" value="" size="30" maxlength="64"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  Email
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="text" id="EMAIL_FIELD" name="EMAIL_FIELD" value="" size="30" maxlength="64"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  Mobile
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="text" id="EMVCELLPHONE_FIELD" name="EMVCELLPHONE_FIELD" value="" size="30" maxlength="64"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  Nearest shop
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;select id="STORE_NAME_FIELD" name="STORE_NAME_FIELD"&gt;
                  &lt;option selected value=""&gt;&lt;/option&gt;
                  &lt;option value="Aberdeen "&gt;Aberdeen &lt;/option&gt;
                  &lt;option value="Acton "&gt;Acton &lt;/option&gt;
                  &lt;option value="Aldgate "&gt;Aldgate &lt;/option&gt;
                  &lt;option value="Ashford "&gt;Ashford &lt;/option&gt;
                  &lt;option value="Aylesbury "&gt;Aylesbury &lt;/option&gt;
                  &lt;option value="Baker Street "&gt;Baker Street &lt;/option&gt;
                  &lt;option value="Balham "&gt;Balham &lt;/option&gt;
                  &lt;option value="Ballymena "&gt;Ballymena &lt;/option&gt;
                  &lt;option value="Barnet "&gt;Barnet &lt;/option&gt;
                  &lt;option value="Beckenham "&gt;Beckenham &lt;/option&gt;
                  &lt;option value="Belfast "&gt;Belfast &lt;/option&gt;
                  &lt;option value="Bethnal Green "&gt;Bethnal Green &lt;/option&gt;
                  &lt;option value="Bexleyheath "&gt;Bexleyheath &lt;/option&gt;
                  &lt;option value="Biggleswade "&gt;Biggleswade &lt;/option&gt;
                  &lt;option value="Birmingham "&gt;Birmingham &lt;/option&gt;
                  &lt;option value="Birmingham New Street "&gt;Birmingham New Street &lt;/option&gt;
                  &lt;option value="Bishopsgate "&gt;Bishopsgate &lt;/option&gt;
                  &lt;option value="Bond Street "&gt;Bond Street &lt;/option&gt;
                  &lt;option value="Bromley "&gt;Bromley &lt;/option&gt;
                  &lt;option value="Camberwell "&gt;Camberwell &lt;/option&gt;
                  &lt;option value="Cambridge "&gt;Cambridge &lt;/option&gt;
                  &lt;option value="Camden Town "&gt;Camden Town &lt;/option&gt;
                  &lt;option value="Chelmsford "&gt;Chelmsford &lt;/option&gt;
                  &lt;option value="Chelsea "&gt;Chelsea &lt;/option&gt;
                  &lt;option value="Cheltenham "&gt;Cheltenham &lt;/option&gt;
                  &lt;option value="Chester "&gt;Chester &lt;/option&gt;
                  &lt;option value="Chiswick "&gt;Chiswick &lt;/option&gt;
                  &lt;option value="Clacton-on-Sea "&gt;Clacton-on-Sea &lt;/option&gt;
                  &lt;option value="Clapham High Street "&gt;Clapham High Street &lt;/option&gt;
                  &lt;option value="Clapham Junction "&gt;Clapham Junction &lt;/option&gt;
                  &lt;option value="Colchester "&gt;Colchester &lt;/option&gt;
                  &lt;option value="Coleraine "&gt;Coleraine &lt;/option&gt;
                  &lt;option value="Covent Garden "&gt;Covent Garden &lt;/option&gt;
                  &lt;option value="Coventry "&gt;Coventry &lt;/option&gt;
                  &lt;option value="Cricklewood "&gt;Cricklewood &lt;/option&gt;
                  &lt;option value="Crouch End "&gt;Crouch End &lt;/option&gt;
                  &lt;option value="Croydon "&gt;Croydon &lt;/option&gt;
                  &lt;option value="Dalston "&gt;Dalston &lt;/option&gt;
                  &lt;option value="Ealing "&gt;Ealing &lt;/option&gt;
                  &lt;option value="Earls Court "&gt;Earls Court &lt;/option&gt;
                  &lt;option value="Edgware "&gt;Edgware &lt;/option&gt;
                  &lt;option value="Exeter "&gt;Exeter &lt;/option&gt;
                  &lt;option value="Farringdon "&gt;Farringdon &lt;/option&gt;
                  &lt;option value="Fleet Street "&gt;Fleet Street &lt;/option&gt;
                  &lt;option value="Fulham "&gt;Fulham &lt;/option&gt;
                  &lt;option value="Glasgow "&gt;Glasgow &lt;/option&gt;
                  &lt;option value="Godalming "&gt;Godalming &lt;/option&gt;
                  &lt;option value="Golders Green "&gt;Golders Green &lt;/option&gt;
                  &lt;option value="Guildford "&gt;Guildford &lt;/option&gt;
                  &lt;option value="Hackney "&gt;Hackney &lt;/option&gt;
                  &lt;option value="Hammersmith "&gt;Hammersmith &lt;/option&gt;
                  &lt;option value="Hampstead "&gt;Hampstead &lt;/option&gt;
                  &lt;option value="Highbury "&gt;Highbury &lt;/option&gt;
                  &lt;option value="Holborn "&gt;Holborn &lt;/option&gt;
                  &lt;option value="Ipswich "&gt;Ipswich &lt;/option&gt;
                  &lt;option value="Angel "&gt;Angel &lt;/option&gt;
                  &lt;option value="Kensington "&gt;Kensington &lt;/option&gt;
                  &lt;option value="Kentish Town "&gt;Kentish Town &lt;/option&gt;
                  &lt;option value="Kilburn "&gt;Kilburn &lt;/option&gt;
                  &lt;option value="Kings Lynn "&gt;Kings Lynn &lt;/option&gt;
                  &lt;option value="Kingston "&gt;Kingston &lt;/option&gt;
                  &lt;option value="Knightsbridge "&gt;Knightsbridge &lt;/option&gt;
                  &lt;option value="Leadenhall Market "&gt;Leadenhall Market &lt;/option&gt;
                  &lt;option value="Lewisham "&gt;Lewisham &lt;/option&gt;
                  &lt;option value="Lisburn "&gt;Lisburn &lt;/option&gt;
                  &lt;option value="Lincoln "&gt;Lincoln &lt;/option&gt;
                  &lt;option value="Londonderry "&gt;Londonderry &lt;/option&gt;
                  &lt;option value="Luton "&gt;Luton &lt;/option&gt;
                  &lt;option value="Maidenhead "&gt;Maidenhead &lt;/option&gt;
                  &lt;option value="Maidstone "&gt;Maidstone &lt;/option&gt;
                  &lt;option value="Mansion House "&gt;Mansion House &lt;/option&gt;
                  &lt;option value="Marble Arch "&gt;Marble Arch &lt;/option&gt;
                  &lt;option value="Marlow "&gt;Marlow &lt;/option&gt;
                  &lt;option value="Marylebone "&gt;Marylebone &lt;/option&gt;
                  &lt;option value="Mayfair "&gt;Mayfair &lt;/option&gt;
                  &lt;option value="Milton Keynes "&gt;Milton Keynes &lt;/option&gt;
                  &lt;option value="Muswell Hill "&gt;Muswell Hill &lt;/option&gt;
                  &lt;option value="Newbury "&gt;Newbury &lt;/option&gt;
                  &lt;option value="Northampton "&gt;Northampton &lt;/option&gt;
                  &lt;option value="Norwich "&gt;Norwich &lt;/option&gt;
                  &lt;option value="Notting Hill Gate "&gt;Notting Hill Gate &lt;/option&gt;
                  &lt;option value="Oxford "&gt;Oxford &lt;/option&gt;
                  &lt;option value="Peckham "&gt;Peckham &lt;/option&gt;
                  &lt;option value="Peterborough "&gt;Peterborough &lt;/option&gt;
                  &lt;option value="Pimlico "&gt;Pimlico &lt;/option&gt;
                  &lt;option value="Portobello "&gt;Portobello &lt;/option&gt;
                  &lt;option value="Putney "&gt;Putney &lt;/option&gt;
                  &lt;option value="Queensway "&gt;Queensway &lt;/option&gt;
                  &lt;option value="Reading "&gt;Reading &lt;/option&gt;
                  &lt;option value="Richmond "&gt;Richmond &lt;/option&gt;
                  &lt;option value="Romford "&gt;Romford &lt;/option&gt;
                  &lt;option value="Shepherds Bush "&gt;Shepherds Bush &lt;/option&gt;
                  &lt;option value="Slough "&gt;Slough &lt;/option&gt;
                  &lt;option value="Soho "&gt;Soho &lt;/option&gt;
                  &lt;option value="South Kensington "&gt;South Kensington &lt;/option&gt;
                  &lt;option value="Southend "&gt;Southend &lt;/option&gt;
                  &lt;option value="St Johns Wood "&gt;St Johns Wood &lt;/option&gt;
                  &lt;option value="Staines "&gt;Staines &lt;/option&gt;
                  &lt;option value="Streatham "&gt;Streatham &lt;/option&gt;
                  &lt;option value="Surbiton "&gt;Surbiton &lt;/option&gt;
                  &lt;option value="Sutton "&gt;Sutton &lt;/option&gt;
                  &lt;option value="Swiss Cottage "&gt;Swiss Cottage &lt;/option&gt;
                  &lt;option value="Sydenham "&gt;Sydenham &lt;/option&gt;
                  &lt;option value="Tooting "&gt;Tooting &lt;/option&gt;
                  &lt;option value="Tottenham Court Road "&gt;Tottenham Court Road &lt;/option&gt;
                  &lt;option value="Tunbridge Wells "&gt;Tunbridge Wells &lt;/option&gt;
                  &lt;option value="Twickenham "&gt;Twickenham &lt;/option&gt;
                  &lt;option value="Uxbridge "&gt;Uxbridge &lt;/option&gt;
                  &lt;option value="Victoria "&gt;Victoria &lt;/option&gt;
                  &lt;option value="Walthamstow "&gt;Walthamstow &lt;/option&gt;
                  &lt;option value="Walworth Road "&gt;Walworth Road &lt;/option&gt;
                  &lt;option value="Wandsworth "&gt;Wandsworth &lt;/option&gt;
                  &lt;option value="Watford "&gt;Watford &lt;/option&gt;
                  &lt;option value="Welwyn Garden City "&gt;Welwyn Garden City &lt;/option&gt;
                  &lt;option value="Westminster "&gt;Westminster &lt;/option&gt;
                  &lt;option value="Wimbledon "&gt;Wimbledon &lt;/option&gt;
                  &lt;option value="Windsor "&gt;Windsor &lt;/option&gt;
                  &lt;option value="Wokingham "&gt;Wokingham &lt;/option&gt;
                  &lt;option value="Wood Green "&gt;Wood Green &lt;/option&gt;
                  &lt;option value="Woolwich "&gt;Woolwich &lt;/option&gt;
                  &lt;/select&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
  
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="hidden" id="STORE_EMAIL_FIELD" name="STORE_EMAIL_FIELD" value=""&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
  
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="hidden" id="WEB_HOME_FIELD" name="WEB_HOME_FIELD" value=""&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
  
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="hidden" id="SOURCE_FIELD" name="SOURCE_FIELD" value="St Petes"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;
                  Opt in to marketing emails
                  &lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="checkbox" id="OPTIN_FIELD" name="OPTIN_FIELD" value="true"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
  
  
                  &lt;tr&gt;
                      &lt;td style="border:1px solid red"&gt;
                      &lt;img id="captcha" src="/maininc/securimage/securimage_show.php" alt="CAPTCHA Image" /&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                      &lt;input type="text" name="captcha_code" size="10" maxlength="6" /&gt;
                  &lt;a href="#" onclick="document.getElementById('captcha').src = '/maininc/securimage/securimage_show.php?' + Math.random(); return false"&gt;[ Different Image ]&lt;/a&gt;
  
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
  
  
                  &lt;tr&gt;
                  &lt;td colspan="2" align="center"&gt;
                  &lt;input type="button" value="Submit Form" onClick="javascript:validForm();"&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/table&gt;
                  &lt;/form&gt;
                  &lt;/body&gt;
                  &lt;/html&gt;
  </code></pre>