Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to not valid fields when reverting
Message
From
06/10/2006 20:18:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/10/2006 12:25:48
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01160114
Message ID:
01160278
Views:
7
>I have several forms that were created by the forms wizard. If I put the code
>
>if empty(this.value)
>   *** display a message
>   return .F.
>endif
>
>in the valid method for the field it always gets executed even whem I click on the revert button. If I do not include "RETURN .F." it works for the revert button but goes to the next field on the form.
>
>What I am I doing wrong?
>
>TIA for any help.

I suggest not to validate at all, in the individual fields.

Postpone all validation, until the user tries to save the record. This approach is much simpler, and more flexible for the user. For instance, the user can input the fields in any order.

Also, you may have validation that spans more than one field, e.g., "debit > 0 XOR credit > 0". It doesn't make much sense to validate that at the field level.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform