Title: Custom inline message based on PHP code
Last modified: December 25, 2022

---

# Custom inline message based on PHP code

 *  Resolved [plgupa](https://wordpress.org/support/users/plgupa/)
 * (@plgupa)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/)
 * Hi,
 * I have created a form. On submission of the form I am doing some database operation
   in action function- ‘forminator_custom_form_submit_before_set_fields’. Based 
   on the result I want to display inline message in the form frontend. Is there
   any way?
 * Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16319966)
 * Hi [@plgupa](https://wordpress.org/support/users/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
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16320027)
 * Hi [@plgupa](https://wordpress.org/support/users/plgupa/),
 * You can use these two hooks for this:
 *     ```wp-block-code
       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:
 *     ```wp-block-code
       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](https://wordpress.org/support/users/plgupa/)
 * (@plgupa)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16320731)
 * 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
 *  Plugin Support [Jair – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport15/)
 * (@wpmudevsupport15)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16326528)
 * Hi [@plgupa](https://wordpress.org/support/users/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_submitforminator_form_before_save_entryforminator_form_after_save_entry
 * Kind regards,
   Zafer
 *  Thread Starter [plgupa](https://wordpress.org/support/users/plgupa/)
 * (@plgupa)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16332512)
 * Hi,
 * To anyone looking for solution. I solved my problem using below method:-
    1. Save the result of form data processing done in action – ‘forminator_custom_form_submit_before_set_fields’
       into database table.
    2. Now, in action – ‘forminator_form_after_save_entry’ edit the inline message 
       based on saved database entry.
 *  Plugin Support [Nebu John – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport14/)
 * (@wpmudevsupport14)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16334220)
 * Hi [@plgupa](https://wordpress.org/support/users/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

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom inline message based on PHP code’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [Nebu John – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport14/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/custom-inline-message-based-on-php-code/#post-16334220)
 * Status: resolved