Bobba Buoy
07-28-2005, 08:34 AM
I am validating 3 forms on a page with seperate functions and none of them work. They are pretty simple. Here is one of them:
In the <head></head> I have this~
<script type="text/javascript">
<!--
function chkRaceDirLogin(){
if (document.race_dir_login.username1.value == '' ||
document.race_dir_login.password1.value == '')
{
alert('Please supply both a user name and password!');
return false;
}
else
return true;
}
-->
</script>
Here is the form~
<form name="race_dir_login" method="post" action="home.asp" onsubmit="return chkRaceDirLogin()">
<table style="border-collapse:collapse">
<tr>
<td style="text-align:center" colspan="2">
<img id="IMG1" src="../images/race_dir.gif" WIDTH="164" HEIGHT="20">
</td>
</tr>
<tr>
<td>
<img src="../images/user_name.gif" WIDTH="61" HEIGHT="21">
</td>
<td>
<input name="user_name1" id="user_name1" size="8" maxlength="10">
</td>
</tr>
<tr>
<td>
<img src="../images/password.gif" WIDTH="61" HEIGHT="21">
</td>
<td>
<input type="password" name="password1" id="password1" size="8" maxlength="10">
</td>
</tr>
<tr>
<td colspan="2" style="text-align:right">
<input type="hidden" id="submit_race_dir" name="submit_race_dir" value="submit_race_dir">
<input type="submit" id="submit1" name="submit1" value="Login">
</td>
</tr>
</table>
</form>
What am I missing?
Thanks!
In the <head></head> I have this~
<script type="text/javascript">
<!--
function chkRaceDirLogin(){
if (document.race_dir_login.username1.value == '' ||
document.race_dir_login.password1.value == '')
{
alert('Please supply both a user name and password!');
return false;
}
else
return true;
}
-->
</script>
Here is the form~
<form name="race_dir_login" method="post" action="home.asp" onsubmit="return chkRaceDirLogin()">
<table style="border-collapse:collapse">
<tr>
<td style="text-align:center" colspan="2">
<img id="IMG1" src="../images/race_dir.gif" WIDTH="164" HEIGHT="20">
</td>
</tr>
<tr>
<td>
<img src="../images/user_name.gif" WIDTH="61" HEIGHT="21">
</td>
<td>
<input name="user_name1" id="user_name1" size="8" maxlength="10">
</td>
</tr>
<tr>
<td>
<img src="../images/password.gif" WIDTH="61" HEIGHT="21">
</td>
<td>
<input type="password" name="password1" id="password1" size="8" maxlength="10">
</td>
</tr>
<tr>
<td colspan="2" style="text-align:right">
<input type="hidden" id="submit_race_dir" name="submit_race_dir" value="submit_race_dir">
<input type="submit" id="submit1" name="submit1" value="Login">
</td>
</tr>
</table>
</form>
What am I missing?
Thanks!