Writing System Field Validation Functions

If you have not already read Chapter 32, "Writing User Validation Functions," you should do so now. This chapter details the validation process.

The system field validation function is different in both parameters and intent from the user field validation function that you install in a field. These functions operate on the string contents of the field and are called to check that the string is a valid string representation for a field of that field type. After this is done, the system field validation function checks that the value is within the specified range for the field, if one is specified. Field validation functions ensure that the string-to-variable conversion functions have a valid string on which to operate.

If appropriate, you can use the system field validation functions. If you are adding a field type that is an extension of an existing field type, you might find it easier to call one of the system field validation functions and add code for the additional checks you need to make.

The system field validation functions are listed in the Function Reference in the categorical listing section of the manual. All the names of these functions begin with "vf_" for validate field. Refer to their function reference pages for details about the actions taken by the system functions.

More:

Specifications for System Field Validation Functions

Checking that the Field Entry is in the Allowed Range

Setting the Field Validation Error Messages


Home Contents Previous Next