Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Placement of Code
Message
From
08/04/2021 11:26:13
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
07/04/2021 14:34:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01679489
Message ID:
01679673
Views:
73
>Thanks for the response. The struggle i have with applying that approach is that i have a base class for all my texboxes some of which do not need validation applied (i.e. email address phone number etc). So how do I fire it off only for those that need the validation code to apply to?
>I thought about setting up a custom class called chckThisBox ( true or false ), and placing that flag in the valid method of the textox (not the class). then once the base class valid method calls the validation method, first thing it looks for IF chckThisbox equals TRUE then proceed with the check.....thoughts on that methodology???

I mean you'd have a separate method in the class. The normal validation triggers this separate one. You put your validation code in this other method, If there is not code, it's not fired.
>
>
>You should add this as a new method to your textbox class. In the classes' valid, call the separate method. All textboxes will inherit. You can override if needed. You don't end up coding every one.
>
>>Howdy and greetings all,
>>
>>I have the below listed code in my textbox Interactive Change box. My goal is to visibly place an error box around the textbox if an data entry error occurs, in think case, if it's empty. Would a better placement of this be in the Valid method?
>>
>>IF EMPTY(ALLTRIM(this.Value))
>> This.parent.First_Name_Error_Shape.Visible = .T.
>>ELSE
>> This.parent.First_Name_Error_Shape.Visible = .F.
>>ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform