Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the next filed?
Message
From
24/10/1997 19:14:32
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00056004
Message ID:
00056641
Views:
29
>>IMHO, there are no normal ways to do this, and this is one more reason to >move validation into one place (e.g. cmdSave.click). However, you can make >some trick using cmdExit.MouseMove event. > >The reason for this Bela, is that the validation will be fired BEFORE the >click. It is not the click of the button that fires the validation. It's >the object's losing focus that fires the validation. Therefore, it's >impossible to know at that point, the point of the focus leaving that >field, where it's going next. > >I'd agree with Edward on this. A CheckSave method at the form level is >better. > >JR We seem to have a long and recurring dispute on in-field validation vs save-time validation. Let me summarize a little: in-field validation: + reacts directly to user input, no delay + some further fields may be dependent on the validity of a field, so it better be valid before we get to these fields + validation code is in the object, not separate - object can be reused in another form - if the field is skipped by clicking to a later field, validation never fires - if user escapes from invalid entry, validation won't let him out; needs some additional coding to fix save-time validation: + all the validation code is in one place + it can be called from anywhere in the form all at once + fires before saving and checks everything, no skipped fields - needs additional coding to set focus back to the erroneous value - needs additional coding if a control is copied to another form I think I've got, if not a best-of-both solution, but an idea for it. The SaveCheck method should call all validations in turn, i.e. for all the objects which may have validation, and AND the results. If any of them fails, SetFocus to the object. This may be done in SaveButton.click; the validable objects should have some property to be recognized as validable (my private candidate is .say property, which I have in all my controls classes; it was originally intended for situations when all the controls were disabled, to be .t. for those which should be re-enabled later). So any object could be validated in-field, and/or from SaveCheck method. Comments? Volunteers?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform