Filter: gform_field_validation
Dynamic Hook Name
This hook supports dynamic naming with the following modifiers:
$form_id$field->id
Example hook names:
gform_field_validation(base hook)gform_field_validation_1(with first modifier value)gform_field_validation_1_2(with all modifier values)
Allows custom validation of the field value.
Parameters
| Name | Type | Description |
|---|---|---|
| $result | array | An array containing the validation result properties. |
| ↳ $is_valid | bool | The field validation result. |
| ↳ $message | array | The field validation message. |
| $value | mixed | The field value currently being validated. |
| $form | array | The form currently being validated. |
| $field | \GF_Field | The field currently being validated. |
| $context | string | The context for the current submission. Possible values: form-submit, api-submit, api-validate. |
Since
Source
Defined in form_display.php at line 2685