devxlogo

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.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Five Early Architecture Decisions That Quietly Get Expensive

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.