Form validation occurs when the user exits the form. When the user exits the form, fm_convert() is called to validate the entries in all fields of the form, convert the field contents into the proper type of data, and copy the converted data into the underlying data variable.
The validation process used by fm_convert() calls for the system to check the validation flag for each field on the form. If any are set as not validated, and if those fields do not have the SKIP option turned ON, the field validation process is carried out for the field. If the REQ_AT_EXIT option is turned ON for the field, the system validation function checks that the user entered something in the field. If the contents of that field pass field validation, the system continues checking the remaining fields. If the field does not pass validation, VAL_ERR is set; also, the action code is set so that the user remains in the same form and the next item to go to is the invalid field. The user is then returned to the form to correct the invalid entry. Once the user is returned to the form, he or she must request to exit the form again.
If the system form validation is completed successfully, the user form validation function is called, if you have installed one. Form validation functions are useful for doing cross-field validation.
Validation of the current field or form does not occur if the user quits the form (i.e., the next action code is AC_QUIT).