General information
Category:
Internet applications
Claludio;
Everyone has a way to solve a problem. This is my approach.
I use the following code for dates and similar code for numeric, etc.
Object level validation code:
'Do not allow user to enter an invalid date format or character...
sub txtDateNotified_OnBlur()
if len(trim(frmLineDetail.txtDateNotified.Value))> 0 then
if Not IsDate(frmLineDetail.txtDateNotified.Value) then
alert ("Not a valid date")
frmLineDetail.txtDateNotified.focus()
end if
end if
end sub
To save data:
Dim sDateNotified
sDateNotified = request.Form("txtDateNotified")
' If nothing is entered supply a null value...
if len(sDateNotified) > 0 then
oRS("ContactDate") = sDateNotified
else
oRS("ContactDate") null
end if
Never expect the user to do the "expected".
Sorry the format sucks but you should get the idea. It is easier to read when you format the code as mine is.
Tom
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only