Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validation in Valid() Or LostFocus()
Message
De
19/08/2000 10:40:48
 
 
À
19/08/2000 10:32:43
Tan Aik Jin
Aranea WebLab Sdn Bhd
Kuala Lumpur, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00407029
Message ID:
00407031
Vues:
23
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform