Information générale
Catégorie:
Applications Internet
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement