Unsubscribed
Programmer
Hi,
I have the following code:
...
if (document.applicationForm.firstname.value == ""
{
alert("Please enter your first name."
document.applicationForm.firstname.select();
document.applicationForm.firstnamelabel.focus();
return false;
}
When this runs, I get the error saying document.applicationForm.firstnamelabel is not an object. However, it is defined further down the page in the form as follows:
<tr>
<td valign="top" WIDTH="30%">
<b><LABEL ID="firstnamelabel" FOR="firstname">First Name:</LABEL></b><br>
</td>
<td valign="top" WIDTH="65%">
<INPUT TYPE="Text" NAME="firstname" VALUE="" MAXLENGTH="40" ID="firstname" TABINDEX="1" onFocus="nextfield ='lastname';">
</td>
</tr>
Could anyone let me know what I've done wrong here? Thanks
I have the following code:
...
if (document.applicationForm.firstname.value == ""
{
alert("Please enter your first name."
document.applicationForm.firstname.select();
document.applicationForm.firstnamelabel.focus();
return false;
}
When this runs, I get the error saying document.applicationForm.firstnamelabel is not an object. However, it is defined further down the page in the form as follows:
<tr>
<td valign="top" WIDTH="30%">
<b><LABEL ID="firstnamelabel" FOR="firstname">First Name:</LABEL></b><br>
</td>
<td valign="top" WIDTH="65%">
<INPUT TYPE="Text" NAME="firstname" VALUE="" MAXLENGTH="40" ID="firstname" TABINDEX="1" onFocus="nextfield ='lastname';">
</td>
</tr>
Could anyone let me know what I've done wrong here? Thanks