|
First, IsDate will tell you whether something is a valid date or not, it's just you have your own definition of valid. But try passing January 41, 2104 and it'll say no way Jose. Also, JavaScript is indeed the way to go here, because it can be done on the client end without having to make a round trip to your web server. And absolutely you can mix JS and ASP. But you seem uncomfortable with the idea, so I'll show you how to do it in ASP using VBScript, and then you can move on when you're ready.
Public Function IsOkayDate(someValue As String) As Boolean
If IsDate(someValue) Then If CDate(someValue) > Now() Then If Format(CDate(someValue), "mm/dd/yyy") = someValue Then Return True
Return False
End Function
Okay, what do I win?
|