Confirmation Page after submitted

Home Forums Quform WordPress Confirmation Page after submitted

This topic is: not resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23158
    paulleaf
    Participant

    Hi There,

    I am following this guide

    Display submitted form data after redirecting to another page

    but i cannot get the data, only got “Form data not found.” in the confirmation page. I think i am confused on how to get the unique id of form and element. I found that there is a “iphorm” before the id number, but it is not in my form and elements, as attached. And i have tried both with and without iphorm, both not working. Please help. Thanks.

    • This topic was modified 6 years, 4 months ago by paulleaf.
    • This topic was modified 6 years, 4 months ago by paulleaf.
    Attachments:
    You must be logged in to view attached files.
    #23170
    paulleaf
    Participant

    I found that this code is for v1 whereas i am using v2, do you have a updated code on v2? Thanks.

    #23171
    paulleaf
    Participant

    The following is the code i tried to modify, not working.

    function my_save_form_data($form)
    {
    $_SESSION[‘quform_1’] = $form;
    }
    add_action(‘quform_post_process_1’, ‘my_save_form_data’);

    function my_display_form_data_1()
    {
    $output = ”;

    if (class_exists(‘quform’) && isset($_SESSION[‘quform_1’]) && $_SESSION[‘quform_1’] instanceof quform) {
    $form = $_SESSION[‘quform_1’];

    $output .= ‘<h2>Thanks, ‘ . $form->getValueHtml(‘quform_1_3’) . ‘!</h2>’;
    $output .= ‘<h3>Your submission has been sent.</h3>’;
    } else {
    $output .= ‘Form data not found.’;
    }

    return $output;
    }
    add_shortcode(‘my_display_form_data_1’, ‘my_display_form_data_1’);

    #23172
    paulleaf
    Participant

    I worked it out, successful code for reference to others,

    function my_save_form_data(array $result, Quform_Form $form)
    {
    $_SESSION[‘quform_1’] = $form;
    }
    add_filter(‘quform_post_process_1’, ‘my_save_form_data’, 10, 2);

    function my_display_form_data_1()
    {
    $output = ”;

    if (class_exists(‘Quform_Form’) && isset($_SESSION[‘quform_1’]) && $_SESSION[‘quform_1’] instanceof Quform_Form) {
    $form = $_SESSION[‘quform_1’];

    $output .= ‘<h2>Thanks, ‘ . $form->getValueHtml(‘quform_1_3’) . ‘!</h2>’;
    $output .= ‘<h3>Your submission has been sent.</h3>’;
    } else {
    $output .= ‘Form data not found.’;
    }

    return $output;
    }
    add_shortcode(‘my_display_form_data_1’, ‘my_display_form_data_1’);

    #23197
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy