Setting the Field Validation Error Messages

If one of the checks you perform in your validation function fails, you should set the global validation error code VAL_ERR and return FALSE.

The validation error codes are #defined in vv_form.h. Their corresponding validation messages are defined in an array in vv_valmsg.c. You can reference one of the system-defined validation error messages or add your own message to the end of the array.

To add a message to the array, first #define an error code name for the validation error message. To allow for expansion of the system, the first validation error code you add should be #defined as VCSVALQ. The second should be #defined as VCSVALQ + 1. VCSVALQ is a #defined value for the number of validation error codes used by the system. By using VCSVALQ, you are ensured that you will not overlap any future additions to the validation error messages.

Next, you should add the message to the validation message array located in vv_valmsg.c. This module should be recompiled and replaced in the library.


Home Contents Previous Next