Home › Forums › Quform WordPress › Going "back" a page and keeping data
- This topic has 9 replies, 2 voices, and was last updated 8 years, 10 months ago by brabox.
- AuthorPosts
- June 8, 2015 at 4:37 pm #15470braboxParticipant
Hello,
I have a form which redirects to another page (via PHP) which has a PHP code that calculates the data to show to the client (front end).I would like to know if it is possible to keep the data (name, email, telephone number etc..) on the form when the client clicks “back” so he would not need to re-type all the data again.
I would add a reset form button for those clients wanted to start fresh.
Please let me know if this is possible,
Thanks, Marco
June 9, 2015 at 12:52 pm #15488AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 9, 2015 at 7:48 pm #15496braboxParticipantHello Ally,
Thanks for the quick response as always.
I removed the code and it worked (windows / Firefox) and i also added a reset button.
I have tested in some other machines and when I “return” back to the page it seems to reset.
Any ideas?
Thanks Marco.
June 10, 2015 at 1:49 pm #15506AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 10, 2015 at 8:23 pm #15513braboxParticipantHello Ally,
Thanks for the code. It did work but now for some reason the reset button does not reset the form.
June 11, 2015 at 10:00 am #15524AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 11, 2015 at 3:43 pm #15541braboxParticipantThank you Ally,
I have tested and it worked now.
Not sure why the previous code didn’t work but here is what i was using.
<button class="resetbutton" onclick="jQuery(this).parents('.iphorm').resetForm(); jQuery.uniform.update();
jQuery(document).ready(function ($) {$('.iphorm_13_2').focus();});return false;"><span class="resetbuttontext">Limpar Formulário</span></button>Anyways, thank you again!
Marco
June 11, 2015 at 4:01 pm #15542braboxParticipantBy the way. Just wanted to confirm if this code is correct. I added 2 more quforms to the original code you gave me.
function my_save_form_values($form)
{
$_SESSION['quform-13']['quform-14']['quform-15'] = $form->getValues();
}
add_action('iphorm_post_process_13', 'my_save_form_values');
add_action('iphorm_post_process_14', 'my_save_form_values');
add_action('iphorm_post_process_15', 'my_save_form_values');function my_get_form_values($form)
{
if (isset($_SESSION['quform-13']['quform-14']['quform-15']) && is_array($_SESSION['quform-13']['quform-14']['quform-15'])) {
$form->setValues($_SESSION['quform-13']['quform-14']['quform-15']);
}
}
add_action ('iphorm_pre_display_13', 'my_get_form_values');
add_action ('iphorm_pre_display_14', 'my_get_form_values');
add_action ('iphorm_pre_display_15', 'my_get_form_values');Thanks.
June 12, 2015 at 7:46 pm #15568AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 12, 2015 at 9:34 pm #15571braboxParticipantThank you Ally,
I will try your code.
You guys have a great support team!.
=)
Marco
- AuthorPosts
- You must be logged in to reply to this topic.