Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using lostfocus to validate?
Message
 
 
À
27/04/2000 12:14:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00363607
Message ID:
00365060
Vues:
25
This doesn't make sense. If the last key the user pressed was the escape key, then the form will be closed and it doesn't matter to the form what the user does after that.

Michelle


>I think there is a big problem with this solution (that is, checking the lastkey()) !!!
>If the last key the user pressed was the escape key and since then, he didn't use the keyboard anymore (only his mouse) and then he tries to quit the field with the valid routine suggested above USING HIS MOUSE, the lastkey still returns 27 though he didn't quit the fields using escapekey, so the validation won't execute though it should !!!!!
>
>BTW : A similar problem exists with the validroutine in gridfields ... (one can quit a field in a grid using the mouse, bypassing it's validmethod, leaving the gridfield with an unchecked value)
>
>My suggestion :
>let the valid routine accept an empty value or a correct value ; when the OK/SAVE/WHATEVER button is pressed check if there are any fields that are empty but shouldn't and refuse the OK/SAVE/... if there are empty fields that shouldn't.
>Disadvantage : the user has to clear the field first if he wants to cancel ...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform