Persistent field value across multi-page form [RESOLVED]

I have a notes field in the right side of my multi-page.
I’d like the contents of this field to be persistent no matter how the user navigates the form pages.

Any bright ideas?

I’ve got the elite perks but the pass-through perk requires a form to actually be submitted, so that’s no good.
The great support staff over there also suggested using the Populate anything perk with live merge tags, but this would only work in one direction. So if the user is on page 3 and jumps back to page 1, the changes wouldn’t carry over.

Appreciate any ideas! Thanks!

1 Like

Ah didn’t realize all pages are available in the DOM.

Bit of jQuery for anyone else looking for this same functionality.
Add the same classname to the fields you want to sync.

$(document).on('change keyup', '.class-of-your-field', function(){
  $('.class-of-your-field').val($(this).val());
});
1 Like

Thank you for the update.

If you don’t want to have to replicate the field on each page and pass the value across, you can use this approach, too.

https://typewheel.xyz/show-fields-across-multiple-pages-gravity-form/

3 Likes

Oh cool, thanks Josh!

Do you have a preference performance-wise?

I’m not sure as to performance comparison. I would guess that the solution I link might be a bit more performant, as less form data is being passed around — just a restructuring of the DOM.

That makes sense, I think you’re right.
Thanks again!

1 Like

A little update to this. If you’re using fieldsets in your form you need to adjust the class the script is prepending to. Instead of .gform_fields, use .gform_page_fields.

jQuery(this).prependTo(#gform_page_{form_id}_{current_page} .gform_page_fields);

Otherwise the script will insert the field once for every fieldset on your page since that create a new ul with the class .gform_fields. In my case it was 7 and it was a bit of a mess. :slight_smile:

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.