Hello @katmacau
Please add the following snippet just after the previously provided code:
add_filter( 'forminator_form_submit_response', 'wpmudev_fix_submission_message_branda', 20, 2 );
add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_fix_submission_message_branda', 20, 2 );
function wpmudev_fix_submission_message_branda( $response, $form_id ){
if( $form_id != 361 ){ //Please change the form ID
return $response;
}
if( $response['success'] ){
$GLOBALS['fm_success_message'] = $response['message'];
}else{
$GLOBALS['fm_error_message'] = $response['message'];
}
add_action('wp_head', 'wpmudev_show_success_message_branda');
return $response;
}
function wpmudev_show_success_message_branda(){
if( !empty( $GLOBALS['fm_success_message'] ) ){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.branda-maintenance #forminator-module-361 .forminator-response-message').removeClass('forminator-error').addClass('forminator-success').addClass('forminator-show').html('<?php echo $GLOBALS['fm_success_message'] ?>');
});
</script>
<?php
}
if( !empty( $GLOBALS['fm_error_message'] ) ){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.branda-maintenance #forminator-module-361 .forminator-response-message').addClass('forminator-show').html('<?php echo $GLOBALS['fm_error_message'] ?>');
});
</script>
<?php
}
}
Form ID should be changed from 361 to your form’s ID in the following lines:
1.
if( $form_id != 361 ){
2.
jQuery('.branda-maintenance #forminator-module-361 .forminator-response-message').removeClass('forminator-error').addClass('forminator-success').addClass('forminator-show').html('<?php echo $GLOBALS['fm_success_message'] ?>');
3.
jQuery('.branda-maintenance #forminator-module-361 .forminator-response-message').addClass('forminator-show').html('<?php echo $GLOBALS['fm_error_message'] ?>');
Warm regards,
Dimitris