This topic is locked

Date validation

7/13/2005 5:37:27 PM
ASPRunnerPro General questions
W
workingfool author

I have a Short Date required field. If end user chooses date picker all is well. If end user mis-types "garbage" in the date field it results in the following error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Replace'
path.../include/data_aspfunctions.asp, line 1441
which is:

Function EscapeQuotes(strValue)

EscapeQuotes = Replace(strValue, "'", "\'")

EscapeQuotes = HTMLEncode(EscapeQuotes)

End Function
If I put words in the Numeric areas, it politely responds to tell me to use numbers. I was hoping the same would occur for mistyped date field.
The above error does not go away until the record is deleted from the db.
Thank you for any assistance on this.

admin 7/14/2005

To validate date input you need to use one of date edit controls like dropdown boxes and/or datepicker.