webtoleadform problem
webtoleadform problem
I have created a web to lead form and placed it in my web page and it works just fine. However, when I view the page in IE I get the following error message:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.3; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; AskTB5.6)
Timestamp: Thu, 27 May 2010 15:48:46 UTC
Message: 'document.getElementById(...)' is null or not an object
Line: 367
Char: 5
Code: 0
URI: http://plastictankshop.com/
Can someone look at my code and make a suggestion as to what I should change to stop this error warning? Thanks in advance for the assistance! Here is my form code:
<style type="text/css">
<!--
.style3 {font-size: 12px}
.style5 {color: #FF0000}
.style12 {font-size: 10px; font-weight: bold; font-family: Georgia, "Times New Roman", Times, serif; }
-->
</style>
<div id='zohoWebToLead' align=center><META HTTP-EQUIV ='content-type' CONTENT='text/html;charset = UTF-8'> <script>
var fieldarray=new Array("Last Name","First Name","Company","Email"); // if you need to have some other fields to be mandatory, please add them here within quotes ("")
function validate()
{
for(var i=0;i<fieldarray.length;i++)
{
var value=document.getElementsByName(fieldarray[i])[0].value;
if(value=="")
{
alert(fieldarray[i]+" cannot be empty");return false;
}
}
}
</script>
<form action="http://crm.zoho.com/crm/WebToLead" method="POST" onSubmit="return validate()"><table width=280 border=0 cellpadding=5 cellspacing=0 bordercolor="#000000" bgcolor="#000066" style='border-top:2px solid #999999;border-bottom:1px solid #999999;background-color:#ffffff;'>
<input type='hidden' name='xnQsjsdp' value=U36xvUpg*w8$/> <input type='hidden' name='xmIwtLD' value=vFUxad27pR4onZWq*J8wfiDPfpWe20lJ/> <input type='hidden' name='actionType' value=TGVhZHM=/> <input type='hidden' name='returnURL' value='http://plastictankshop.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;'><p align="center" class="style12"><img src="http://plastictankshop.com/wp-content/themes/images/download_icon.jpg" width="150" height="66" /><br />
<span class="style5">(* = Required )</span></p> </td>
</tr><tr>
<td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'><span class="style12"><span class="style5">*</span>Company :</span></td>
<td width='75%' class="style3"><input name='Company' type='text' size="20" maxlength='100' /> </td>
</tr><tr>
<td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'><span class="style12"><span class="style5">*</span>First Name :</span></td>
<td width='75%' class="style3"><input name='First Name' type='text' size="20" maxlength='40' /> </td>
</tr><tr>
<td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'><span class="style12"><span class="style5">*</span>Last Name :</span></td>
<td width='75%' class="style3"><input name='Last Name' type='text' size="20" maxlength='80' /> </td>
</tr><tr>
<td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'><span class="style12">Title :</span></td>
<td width='75%' class="style3"><input name='Designation' type='text' size="20" maxlength='100' /> </td>
</tr><tr>
<td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'><span class="style12"><span class="style5">*</span>Email :</span></td>
<td width='75%' class="style3"><input name='Email' type='text' size="20" maxlength='100' /> </td>
</tr><tr>
<td width='25%' align='right' nowrap class="style12">Phone :</td>
<td width='75%' class="style3"><input name='Phone' type='text' size="20" maxlength='30' /></td>
</tr><tr><td colspan=2 align=center class="style3" style='background-color:#eaeaea'><input type='submit' name='save' value= Submit /></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>