This event occurs when a when user attempts to set a new value for a List or Boolean field on the form.
SyntaxField_OnValidate FieldName , FieldValue )
- The name of the field to validate.
- The value of the field to validate.
You can use this event to perform tasks such validating user input for a form field. If the return value is empty string then validation is assumed to have been successful.
Function Field_OnValidate(FieldName, FieldValue) Field_OnValidate = "" 'Write custom validation to check that the user is attempting to enter a value for ‘the Amount field that is less than 100. If (FieldName = “Amount”) Then If (CInt(FieldValue) > 100) Then Field_OnValidate = “Amount cannot be greater than 100.” End If End If End Function