When a text input field is actioned (by modifying it and Tabbing away, or pressing ENTER, or when a button on the form is pressed or the form's
OKcall is executed), it is automatically checked to make sure that the typed-in value matches the field's
TYPE and its
FORMAT constraints. If so, then your
VALIDATECALL is actioned.
The VALIDATECALL is used to apply any checks you want. If an error is encountered then the callback raises the error and returns.
The VALIDATECALL is a standard callback, and so it can be a single command, a PML function, method or macro, or an open PML method or function. For an open callback, for example:
The form !!ValidForm has two text fields of types
REAL and
STRING.
The textvalidate method determines from its
!textin parameter which field is being validated, and applies the constraints that have been defined. The Handle block traps any unexpected PML errors generated by the validation code. The first if-block of the validation code checks that the text field is not unset. This also prevents the possibility of unexpected errors in the validation code.