• Resolved smishra

    (@smishra)


    I want to show form id to the user as a reference for later use. what should I add to “after submission field”

    Thank you for contacting us, we will be in touch shortly. note down request id [id]

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @smishra ,

    It looks like there is no way to do that out of the box, however, we might have some custom code that would do that.
    I will ping our developers and they will check that.
    We will let you know.

    kind regards,
    Kasia

    Thread Starter smishra

    (@smishra)

    Thanks Kasia for your reply. i further want to add that I am able to set any parameter to show a user after form submission. I want to know the Code which i can add to show [form entry number] to show the customer his number in the queue.

    i am attaching a picture to show what exactly i want image for sample

    • This reply was modified 5 years, 8 months ago by smishra.
    • This reply was modified 5 years, 8 months ago by smishra.
    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @smishra

    I trust you’re doing well!

    Please add the following code as a mu-plugin. Create a mu-plugins folder if doesn’t exist, inside wp-content. Create a forminator-response.php file and add the following code:

    <?php
    
    // Adds the "Custom ID" to fields selection.
    add_filter(
        'forminator_vars_list',
        function( $vars ) {
            $vars['custom_id'] = 'Custom ID';
            return $vars;
        },
        15
    );
    
    // Filters the Success message and replaces the {custom_id} with the submission ID.
    add_filter(
        'forminator_custom_form_ajax_submit_response',
        function( $response, $form_id ) {
            $user_ip    = Forminator_Geo::get_user_ip();
            $last_entry = Forminator_Form_Entry_Model::get_last_entry_by_ip_and_form( $form_id, $user_ip );
    
            $response['message'] = str_replace( '{custom_id}', $last_entry, $response['message'] );
    
            return $response;
        },
        15,
        2
    );

    Once the file is added, edit the thank you message in a form and add a Custom ID macro. Please see this screenshot:
    https://take.ms/VoEfEo

    Note that this code is required to read visitor’s IP address.

    Hope this helps!

    Cheers,
    Nastia

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing form id to user in Confirmation message’ is closed to new replies.