E
eric.goforth
Hello,
I'm getting a form undefined when I try to validate a date field. I've
created a much simpler version of my web page that reproduces the
issue, can anyone tell me why I can't access the Text field on my form
like I'm trying to do?
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
</head>
<body>
<title>Test</title>
<TABLE border="0" cellpadding="0" cellspacing="0">
<table cellpadding="4" cellspacing="4" border="0" width="100%">
<tr>
<td class="bodyMain">
<form method="post" name="form1" onsubmit="javascript:
checkdatefield();" action="">
<tr>
<td>Effective Date:</td>
<td><input tabindex="1" maxlength="50" type="Text" Id="sMyDate"
Name="sMyDate" SIZE="10" value="01-05-2006"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="3" cellspacing="0" border="0">
<tr>
<td valign="top" align="left" colspan="4" class="data">
<input type="Button" class="button" name="Cancel"
onClick="window.location='takemeback';" value="Cancel"><input
type="submit" value="Save">
<SCRIPT language="javascript">
function checkdatefield(){
var currDate=new Date() //Get todays date
if (form.sMyDate.value > currDate) //Compare dates
(simplified, the original stuff called a function)
{
if (confirm("Danger Will Robinson Danger!!!"))
alert("yes");
else
alert("no")
}
}
</SCRIPT>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</TD>
</TR>
</TABLE></body>
</html>
I'm getting a form undefined when I try to validate a date field. I've
created a much simpler version of my web page that reproduces the
issue, can anyone tell me why I can't access the Text field on my form
like I'm trying to do?
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
</head>
<body>
<title>Test</title>
<TABLE border="0" cellpadding="0" cellspacing="0">
<table cellpadding="4" cellspacing="4" border="0" width="100%">
<tr>
<td class="bodyMain">
<form method="post" name="form1" onsubmit="javascript:
checkdatefield();" action="">
<tr>
<td>Effective Date:</td>
<td><input tabindex="1" maxlength="50" type="Text" Id="sMyDate"
Name="sMyDate" SIZE="10" value="01-05-2006"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="3" cellspacing="0" border="0">
<tr>
<td valign="top" align="left" colspan="4" class="data">
<input type="Button" class="button" name="Cancel"
onClick="window.location='takemeback';" value="Cancel"><input
type="submit" value="Save">
<SCRIPT language="javascript">
function checkdatefield(){
var currDate=new Date() //Get todays date
if (form.sMyDate.value > currDate) //Compare dates
(simplified, the original stuff called a function)
{
if (confirm("Danger Will Robinson Danger!!!"))
alert("yes");
else
alert("no")
}
}
</SCRIPT>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</TD>
</TR>
</TABLE></body>
</html>