// apply only to field 3 in form 1 add_filter( 'gform_field_validation_1_3', 'character_validation', 10, 4 ); function character_validation( $result, $value, $form, $field ) { // Check if value contains only letters (A-Z and a-z) if ( ! preg_match( '/^[A-Za-z]+$/', $value ) ) { $result['is_valid'] = false; $result['message'] = 'Please enter only letters (A-Z).'; } return $result; }
Skip to content