Web-to-Contacts Validation Field

Web-to-Contacts Validation Field

Hello I created a Web-to-contact form and I added the verification code as proposed by zoho. Now I'm trying to make some fields required but I can't figure it. I used the code from zoho but it doesn't work... Here is what I have so far..



<html>

<body><div id='crmWebToEntityForm' align=center><META HTTP-EQUIV ='content-type' CONTENT='text/html;charset = UTF-8'>  <form action='https://crm.zoho.com/crm/WebToContactForm' name="contactForm" method='POST' onsubmit="return validateForm()"><table border=0 cellspacing=0 cellpadding=5 width=480 style='border-top:2px solid #999999;border-bottom:1px solid #999999;background-color:#ffffff;'>  <input type='hidden' name='xnQsjsdp' value=42Ox4h0d34c$/>  <input type='hidden' name='xmIwtLD' value=ksCSnRONGHQnv1lj3wF972-*B6-MHnNR/>  <input type='hidden' name='actionType' value=Q29udGFjdHM=/> <input type='hidden' name='returnURL' value='http://lovelycutsgrooming.com' /> <br><tr><td colspan='2' align='left' style='background-color:#f5f5f5;border-bottom:2px dotted #dadada; color:#000000;font-family:sans-serif;font-size:14px;'><strong>Web Form</strong></td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>First Name &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='40' id='fname' name='fname' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Last Name &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='80' name='lname' id='lname' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Email &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='100' name='email' id'email' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Phone &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='50' name='phone' id='phone' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Mobile &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='30' name='mobile' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Date of Birth &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='20' name='Date of Birth' />MM/dd/yyyy </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Mailing Street &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='250' name='mailingstreet' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Mailing City &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='30' name='mailingcity' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Mailing State &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='30' name='mailingstate' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Mailing Zip &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='30' name='mailingzip' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>First Visit &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='20' name='firstvisit' />MM/dd/yyyy </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Shot's up to Date? &nbsp;&nbsp;:</td><td width='75%'><input type='checkbox' name='CONTACTCF110' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Breed &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='50' name='CONTACTCF2' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Pet Age &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='20' name='CONTACTCF3' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Pet Name &nbsp;&nbsp;:</td><td width='75%'><input type='text' maxlength='20' name='CONTACTCF1' /> </td></tr><tr><td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Allergies/Health Problems &nbsp;&nbsp;:</td><td width='75%'> <textarea name='CONTACTCF4' maxlength='1000' width='250' height='250'></textarea></td></tr><tr>
   <td style="font-family: sans-serif; font-size: 12px;" class="feature-border" align="right" nowrap="nowrap" width="29%">Verification Code:</td>
   <td class="feature-border" align="left" valign="middle" width="66%"><input name="varifyNumHidden" id="varifyNumHidden" value="701469" type="hidden">
   <input name="enterVerify" id="enterVerify" type="text">&nbsp;<div id="varifyNum" style="font-size: 14px; font-family: Arial,Helvetica,sans-serif; font-weight: bold;"></div></td>
</tr><tr><td colspan=2 align=center style='background-color:#eaeaea'> <input type='submit' name='save' value=Save /> &nbsp; &nbsp; <input type='reset' name='reset' value=Reset /> </td></tr></table>  </form>
  
<script> 
    function randomgen()
{
    var rannumber='';
    for(ranNum=1; ranNum<=6; ranNum++){
    rannumber+=Math.floor(Math.random()*10).toString();
    }
    document.getElementById('varifyNum').innerHTML=rannumber;
    document.getElementById('varifyNumHidden').value=rannumber;
}
randomgen();
//Varification number genarate code End here    
//Validation Start Here    
function validateForm()
{
    var thefrm=document.contactForm;
    if(thefrm.enterVerify.value=="")
    {
        alert("Enter your Verification Code");
        thefrm.enterVerify.focus();
        return false;
    }
    else if(thefrm.enterVerify.value!="")
    {
        if(thefrm.enterVerify.value!=thefrm.varifyNumHidden.value)
        {
            alert("please Enter Currect Verification Number");
            randomgen();
            thefrm.enterVerify.select();
            thefrm.enterVerify.focus();
            return false;
        }
        else
        {
            return true;
        }
    }
    else
    {
        return true;
    }
}
</script>

</div>
</body>
</html>