Home › Forums › Quform WordPress › Confirmation Page after submitted
- This topic has 4 replies, 2 voices, and was last updated 7 years, 8 months ago by
Ally.
- AuthorPosts
- November 20, 2017 at 8:39 am #23158
paulleaf
ParticipantHi 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 7 years, 8 months ago by
paulleaf.
- This topic was modified 7 years, 8 months ago by
paulleaf.
Attachments:
You must be logged in to view attached files.November 21, 2017 at 4:28 am #23170paulleaf
ParticipantI found that this code is for v1 whereas i am using v2, do you have a updated code on v2? Thanks.
November 21, 2017 at 4:39 am #23171paulleaf
ParticipantThe 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’);November 21, 2017 at 5:12 am #23172paulleaf
ParticipantI 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’);November 22, 2017 at 5:27 pm #23197Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- This topic was modified 7 years, 8 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.