Hi,
I am maintaing an application which uses perl as the web language. On Netscape 4.7 (not IE) if the Date text field is entered incorrectly, the alert box never disappears when you click OK. The source html code is below. How to solve this problem? Thanks a lot
Lisa
------------------
<head>
<html>
<script language="javascript">
function validDate( dateStr )
{
var datePattern = /[0-9]{1,2}-[a-zA-Z]{3}-[0-9]{4}/;
if ( dateStr != "" ){
if (!datePattern.test(dateStr))
alert("Invalid date format. Format required is DD-MON-YYYY."
}
}
</script>
</head>
<body>
<table>
<form name=form1 action=a.html>
<TR>
<td class="reqFont" align="left" width="100" height="30">
<b>Requested Completion Date</b>
</td>
<td class="reqFont" height="30" align="left" width="100">
<input type="text" name="DATE" value="" onBlur="validDate(this.value)">
<a href="#" onClick="window.dateField=document.reqTabForm.DATE;calendar=window.open('../html/calendarWin.htm', 'cal', 'width=200,height=250,top=' + dialogHeight + ',left=' + dialogWidth); return false" tabindex="-1"><img src="../images/calendarbutton.gif" border=0 width="20" height="20" alt="Date format: DD-MON-YYYY
(example: 01-JAN-2002)">
</a>
</td>
</TR>
<TR>
<td class="reqFont" align="left" width="100" height="30">
<b>hh</b>
</td>
<td width="30" height="30">
hh <input type="text" name="TO_TEST_TITLE" size="46" maxlength="46" value="">
</td>
</TR>
</form>
</table>
</body>
</html>
-----------------------
I am maintaing an application which uses perl as the web language. On Netscape 4.7 (not IE) if the Date text field is entered incorrectly, the alert box never disappears when you click OK. The source html code is below. How to solve this problem? Thanks a lot
Lisa
------------------
<head>
<html>
<script language="javascript">
function validDate( dateStr )
{
var datePattern = /[0-9]{1,2}-[a-zA-Z]{3}-[0-9]{4}/;
if ( dateStr != "" ){
if (!datePattern.test(dateStr))
alert("Invalid date format. Format required is DD-MON-YYYY."
}
}
</script>
</head>
<body>
<table>
<form name=form1 action=a.html>
<TR>
<td class="reqFont" align="left" width="100" height="30">
<b>Requested Completion Date</b>
</td>
<td class="reqFont" height="30" align="left" width="100">
<input type="text" name="DATE" value="" onBlur="validDate(this.value)">
<a href="#" onClick="window.dateField=document.reqTabForm.DATE;calendar=window.open('../html/calendarWin.htm', 'cal', 'width=200,height=250,top=' + dialogHeight + ',left=' + dialogWidth); return false" tabindex="-1"><img src="../images/calendarbutton.gif" border=0 width="20" height="20" alt="Date format: DD-MON-YYYY
(example: 01-JAN-2002)">
</a>
</td>
</TR>
<TR>
<td class="reqFont" align="left" width="100" height="30">
<b>hh</b>
</td>
<td width="30" height="30">
hh <input type="text" name="TO_TEST_TITLE" size="46" maxlength="46" value="">
</td>
</TR>
</form>
</table>
</body>
</html>
-----------------------