I am not able to figure out why it is not tracing value for CompanyType. If I remove the CompanyType block from verification, it works well. It even successfully verifies CompanyName, but it fails at CompanyType.
Below is the code:
<script type="text/javascript>
//Check Company Name
if (document.getElementById("CompanyName").value == "")
{
alert("Please enter company name");
document.getElementById("CompanyName").focus();
return false;
}
//Check Company Type alert(document.getElementById("CompanyType").value);
if (document.getElementById("CompanyType").value.substr(0,6) == "Select")
{
alert("Please select company type");
document.getElementById("CompanyType").focus();
return false;
}
</Script>
Following lines follow in the HTML code in the file:
<td align="left" valign="top">
<input maxlength="40" size="22" name="CompanyName" id="CompanyName" style="width:150px;">
</td>
</tr>
<tr>
<td height="38" colspan="2" valign="middle" id="form">
<span class="red">*</span>
<span class="style2">Company Type:</span>
</td>
<td align="left">
<select id=" " class="style3" size="1" name="CompanyType" style="width:150px;"> <option value="" selected="selected">Select One</option> </select></td>