I am using a custom action with the Form Element and after doing a whole lot of stuff in the custom action, I want to get a number to be displayed in place of the default success message. This is my code:
$str_width = $fields['form-field-mbszoi']; //It's a number field
$form->set_result([
'action' => 'my_form',
'type' => 'success', //or danger or info
'message' => esc_html__( strval($str_width), 'bricks'),
]);
}
add_action( 'bricks/form/custom_action', 'my_form_custom_action', 10, 1 );
It returns the default: Message successfully sent. We will get back to you as soon as possible.
The data I am trying to display, $str_width, is a number, but it doesn’t work even when a word is passed.
It just shows up a blank green container for the message. Any help would be greatly appreciated.