Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating user input
Message
From
17/04/1998 18:34:44
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00093073
Message ID:
00093079
Views:
23
>Where is the best place to validate user input ? I used (FPW 2.6) to make validations in the "When" event of the "Ok"/"Save" button, but I can't set the focus back to the right control.
>
>What is your opinion about this ?

I run a CheckValid method when Save is clicked to check for everything. I create a global array to hold error messages (validation failure, not system errors) and matching controls. If there are any validation failures I set a form ValidErrors property to TRUE. I then show a modal form listing all validation failures with an OK button. When they hit OK and focus returns to the calling form, if the ValidErrors property is TRUE, I use form.control.SetFocus() to the first control in the array.

I just don't like using LostFocus or Valid for anything but very rudimentary checking, such as blanks and such.

Just my thoughts.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform