Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with empty date in ASP
Message
 
To
01/03/2001 01:58:55
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00480841
Message ID:
00480972
Views:
9
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
Map
View

Click here to load this message in the networking platform