hello i'm having trouble with some form validation, the code is
<script language="JavaScript">
<!--
function validate(form)
{
if (form.sub_name.value.length == 0)
{
alert("Please enter your first name."
form.sub_name.focus()
return false
}
}
//-->
</script>
in the head of the html document and then
<tr height="5%">
<td width="35%">
<strong>Name:</strong>
</td>
<td width="65%" align="right">
<input type="text" id="sub_name" name="sub_name">
</td>
</tr>
in the body, and nothing happens when I hit submit.
Any help would be greatly appretiated!
<script language="JavaScript">
<!--
function validate(form)
{
if (form.sub_name.value.length == 0)
{
alert("Please enter your first name."
form.sub_name.focus()
return false
}
}
//-->
</script>
in the head of the html document and then
<tr height="5%">
<td width="35%">
<strong>Name:</strong>
</td>
<td width="65%" align="right">
<input type="text" id="sub_name" name="sub_name">
</td>
</tr>
in the body, and nothing happens when I hit submit.
Any help would be greatly appretiated!