Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @vladimirk87,

    Seems like the custom value is missing from your screenshot:
    https://imgur.com/oDCtH0y

    However, I’m afraid, the above code will only save a random number after the form is submitted, it’ll not add the random number during redirection.

    Could you please confirm the workflow you are looking to achieve? Do you want to save the random number and also have that URL as a redirect?

    Or just having a random number in the URL should be enough?

    If its only about adding a random number in the URL, then you might find the following helpful:

    https://www.ads-software.com/support/topic/serial-number-or-auto-increment-number-field-3/#post-16797569

    The above code does work when tested.

    Please do confirm the workflow you are looking to achieve, so that we can assist further if needed.

    Best Regards,

    Nithin

    Thread Starter vladimirk87

    (@vladimirk87)

    Hi,

    What I wanted initially is to pass the submission ID number redirected URL as a parameter, so that other form can take that value into it’s field. I tried that with a hidden field but it didn’t work.

    The instruction from this link works https://www.ads-software.com/support/topic/serial-number-or-auto-increment-number-field-3/#post-16797569 but the problem is that I want the same value to be sent also in Forminator form on submission. It only passes it as a parameter into the redirected URL to another form.

    Regards,

    Vladimir

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @vladimirk87,

    Thanks for explaining further. I do get you and will check with our developer to see if there is any workaround that could be suggested with the existing snippets shared.

    We’ll soon keep you posted via the ticket once we get further feedback asap.

    Best Regards,

    Nithin

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @vladimirk87,

    I hope you’re doing well today!

    What I wanted initially is to pass the submission ID number redirected URL as a parameter, so that other form can take that value into it’s field.

    Here’s a PHP snippet which should help you implement the above behavior:

    <?php
    add_filter( 'forminator_form_submit_response', 'wpmudev_add_submission_id_redirect' , 20, 2 );
    add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_add_submission_id_redirect' , 20, 2 );
    function wpmudev_add_submission_id_redirect( $response, $form_id ) {
        if ( $form_id == 6 ) { //Please change the form ID
            $last_entry = Forminator_Form_Entry_Model::get_latest_entry_by_form_id( $form_id );
            if ( is_object( $last_entry ) ) {
                $response['url'] = str_replace('submission_id', $last_entry->entry_id, $response['url']);
            }
        }
        
        return $response;
    }

    – replace “6” with your form ID on this line:

    if ( $form_id == 6 ) { //Please change the form ID

    After that copy and paste all the code into a text editor, and save as a file with .php extension, for instance “forminator-add-submission-id-redirect.php“.

    Upload the saved file to /wp-content/mu-plugins/ so that it runs as a must use plugin.

    Let us know if you need any further assistance!

    Best Regards,
    Dmytro

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @vladimirk87 ,

    We haven’t heard from you for over a week now, so it looks like my colleague’s code solved the issue.

    Feel free to re-open this topic if needed.

    Kind regards
    Kasia

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Pass the field value into redirected url’ is closed to new replies.