• Resolved scriptic

    (@scriptic)


    I currently have a form set up to display different messages depending on the answers to certain questions. This was set up in the Behavior tab, and it’s successfully working to show a message after submission.

    Is it possible to include these submission inline messages in the final copy of the submitted form? For example, when viewing the form responses under the Submissions tab, I’d like to see the message response generated based on the answers.

    • This topic was modified 1 year ago by scriptic.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @scriptic,

    I hope you are keeping well and thank you for reaching out to us.

    An out of the box solution is not possible for this. I have asked our developers if a workaround could be suggested. We’ll update you here once we have feedback on this as soon as possible.

    Kind Regards,
    Nebu John

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @scriptic

    add_action( 'plugins_loaded', 'wpmudev_forminator_add_redirect_url_to_hidden_field_func', 100 );
    
    function wpmudev_forminator_add_redirect_url_to_hidden_field_func() {
    	if ( defined('FORMINATOR_PRO') && class_exists( 'Forminator' ) ) {
    		class wpmudev_forminator_add_redirect_url_to_hidden_field_func{
    			private $form_id = 6;//enter form_id here
    			private $redirect_url;
    
    			public function __construct() {
                    add_filter( 'forminator_form_submit_response', array( $this, 'get_redirect_url_form_submission' ), 20, 2 );
                    add_filter( 'forminator_form_ajax_submit_response', array( $this, 'get_redirect_url_form_submission'), 20, 2 );
                    add_action( 'forminator_form_after_handle_submit', array( $this, 'add_redirect_url_to_hidden_field'), 10, 2);
    				add_action( 'forminator_form_after_save_entry', array( $this, 'add_redirect_url_to_hidden_field'), 10, 2);
    			}
    
    
    			public function get_redirect_url_form_submission( $response, $form_id ) {
    				if ( $this->form_id == $form_id ) {
    					$this->redirect_url = $response['message'];
    				}
    
                    return $response;
    			}
    
    			public function add_redirect_url_to_hidden_field( $form_id, $response ) {
    				if ( $this->form_id == $form_id ) {
    					$entry_meta = array(
    						array(
    						'name' => 'hidden-1',
    						'value' => $this->redirect_url
    						)
    					);
    					$entries = Forminator_API::get_entries( $form_id );
    					Forminator_API::update_form_entry( $form_id, $entries[0]->entry_id, $entry_meta );
    				}
    			}
    
    		}
    
    		$run = new wpmudev_forminator_add_redirect_url_to_hidden_field_func;
    	}
    }

    This snippet should help to store submission message in hidden-1 and form ID 6 should be changed.

    He is a guide on how to install mu-plugin:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Kind Regards,
    Kris

    Hi @scriptic,

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved. Note that you can still reply on this topic.

    If you have any additional questions or require further help, please let us know!

    Best regards,
    Laura

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘View behavior messages in copy of submitted form’ is closed to new replies.