Hi @plgupa,
I’m checking with our developer to see what would be the best approach in such use case and will get back once we get further update asap.
Best Regards,
Nithin
Hi @plgupa,
You can use these two hooks for this:
forminator_form_submit_response
forminator_form_ajax_submit_response
The above two filters can be used to change the in line message. The 1st hook is when page reload submission is enabled and the 2nd is for Ajax Submission.
For example, the following code changes the response URL, you could use the following example as a reference to change the response message:
add_filter( 'forminator_form_submit_response', 'wpmudev_formi_response_data', 20, 2 );
add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_formi_response_data', 20, 2 );
function wpmudev_formi_response_data( $response, $form_id ){
if( $form_id != 361 ){
return $response;
}
$response['url'] = 'http://mylocal.local/';
return $response;
}
Please note that the above is more of an example. The 361 in the above code is the form id where the code is supposed to work.
I hope this helps in moving forward.
Kind Regards,
Nithin
Thread Starter
plgupa
(@plgupa)
Hi,
Thanks for the reply. This filter can change the response message.
But I want to change response message based on some database processing done on form data. In this filter I am not getting form data. Is there any way to get it?
Note:- As mentioned earlier I am using an action to perform database processing – ‘forminator_custom_form_submit_before_set_fields’
Thanks
Hi @plgupa,
I hope you are doing well today!
You can check the following actions that you can use after form submission;
forminator_form_before_handle_submit
forminator_form_after_handle_submit
forminator_form_before_save_entry
forminator_form_after_save_entry
Kind regards,
Zafer
Thread Starter
plgupa
(@plgupa)
Hi,
To anyone looking for solution. I solved my problem using below method:-
- Save the result of form data processing done in action – ‘forminator_custom_form_submit_before_set_fields’ into database table.
- Now, in action – ‘forminator_form_after_save_entry’ edit the inline message based on saved database entry.
Hi @plgupa,
Glad to know you have managed to solve the problem. Please feel free to open a new ticket if you need any other help, we are happy to assist.
Kind Regards,
Nebu John