devxlogo

Field-level and interfield validations

Field-level and interfield validations

Question:
Field-level validations should be done when the user visits the field. How can this be done?

Interfield validations on the same screen also should be done when the user visits the latter field. Is this possible?

Answer:
The perfect method for validation is the aptly named Validate(), fired whenever a user changes a value in a fieldand leaves the field.

Regarding interfield validation, your description is slightly off base. Ina graphical application, you have no way of controlling which field is ‘last’ to be visited. The way I would implement this isto declare a user-defined method and call the method from theValidate() method for all of the the fields that participate in thevalidation.

devx-admin

Share the Post: