;;;where the user enters dates.
I choose to use a date picker. this way they can not enter dates incorrectly
;;isdate function in an asp form and this picks up any obvious errors
IMO They are not errors. End user are entering the wronf format probably because your form is clearly poorley validated.
;;I have had a look around and found that this is a fault of isdate
There is no fault in the isDate function, we all use it.
;;both dates as correct
Yes both formats are correct, so is yyyy/../...
;;;Does anybody have any date checking code that we can use that will only accept U.K dates?
you can use the following function to get dd/mm/yyyy (it is called audate because it gives me an Australian date:
FUNCTION auDate(varDate)
IF isNull(varDate) OR Trim(varDate) = "" OR varDate = "Null" THEN
auDate = "Null"
ELSE
auDate = "" & day(DateValue(varDate)) & "/" & month(DateValue(varDate)) & "/" & Year(DateValue(varDate)) & " " & TimeValue(varDate) & ""
END IF
END FUNCTION
Use it like so (dont forget to trim all your values, a good practice):
auDate(trim(request.form("yourDateFieldname")))
The above function is very easy to tweak into what ever date format you would like
Wind is your friend
Matt
|