Home › Forums › Quform WordPress › Pass form data to landing page in V2
- This topic has 2 replies, 2 voices, and was last updated 6 years, 1 month ago by Ally.
- AuthorPosts
- March 11, 2018 at 11:59 am #24618airweb7Participant
Hello
I’m trying to pass form data to a page but i have always the message “No datas form found”
function my_save_form_data( $form )
{
$_SESSION['quform_6'] = $form;
}
add_filter('quform_post_process_6', 'my_save_form_data', 10, 2);
and
function my_display_form_data_6( )
{$output = '';
if (class_exists('Quform_Form') && isset($_SESSION['quform_6']) && $_SESSION['quform_6'] instanceof Quform_Form) {
$form = $_SESSION['quform_6'];$output .= '<h2>Merci, ' . $form->getValueHtml('quform_6_14') . '!</h2>';
$output .= '<h3>Nous avons bien reçu votre demande de réservation.</h3>';$output .= '<table>';
$output .= '<tr><td>Name</td><td>' . $form->getValueHtml('quform_6_14') . '</td></tr>';
$output .= '<tr><td>Email</td><td>' . $form->getValueHtml('quform_6_18') . '</td></tr>';
$output .= '<tr><td>Message</td><td>' . $form->getValueHtml('quform_6_24') . '</td></tr>';$output .= '</table>';
} else {
$output .= 'Données du formulaire introuvables !';
}return $output;
}
add_shortcode('my_display_form_data_6', 'my_display_form_data_6');
Thank you for your help
- This topic was modified 6 years, 1 month ago by airweb7.
March 11, 2018 at 12:35 pm #24620airweb7ParticipantHello
I found another way to do it
Adding to functions.php
function URLParam( $atts ) {
extract( shortcode_atts( array(
'param' => 'param',
), $atts ) );
return $_GET[$param];
}
add_shortcode('URLParam', 'URLParam');
Now in the page, use this shortcode :
[URLParam param='booking_date']
where “booking_date” is added as query string to the form “Confirmation settings” section :
booking_date={element|id:21|Select date}
March 14, 2018 at 4:04 pm #24670AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- This reply was modified 6 years, 1 month ago by Ally.
- AuthorPosts
- You must be logged in to reply to this topic.