Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with empty date in ASP
Message
 
À
01/03/2001 01:58:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00480841
Message ID:
00480972
Vues:
8
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
Fil
Voir

Click here to load this message in the networking platform