Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation in Valid() Or LostFocus()
Message
From
19/08/2000 10:40:48
 
 
To
19/08/2000 10:32:43
Tan Aik Jin
Aranea WebLab Sdn Bhd
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00407029
Message ID:
00407031
Views:
22
>Generally, you guys prefer to to do your data validation in the valid() or lostfocus() event ? Which is better ?
>Thanks in advance for you great guys advice.

Depends on what you're validating. format? required? value compared to another value?
I never use the LostFocus() for validation. For performing some action based on the value, maybe.

If the field absolutely has to be validated before letting the user out of it, I use the Valid().
If the control is bound to a field, VFP handles some of this for you. (no alpha in numeric fields, date field formats, etc.)

Mostly, though, I handle validation before attempting to save the data. That way I can catch all problems with it and give the user one error message so they can fix it all at once.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform