Copying values from fields on one page of form to fields on another page

By: Karen Robinson | Asked: 01/31/2023
ForumsCategory: Code HelpCopying values from fields on one page of form to fields on another page
Karen Robinson asked 1 year ago
Hi all! I am setting up a form for a client's website and added some javascript to it to copy values entered into a set of address fields into another set of address field in the same form (before the entry is submitted). The form is setup with 'next' buttons so there are 8 pages to the form in total. I've tried to do the same thing later on in the form, but I can't get it to copy the details from page 3 of the form to page 5. Could anyone advise me on how to get the address fields to copy from page 3 of the form to page 5 of the form? TIA! :)
3 Answers
Bobby Clapp answered 1 year ago
What happens if you just directly add the previous fields shortcode (ex. [32]) to the text box later in the form?
Karen Robinson answered 1 year ago
Hi Bobby! I thought about that solution, but the client wants it to be a checkbox on the subsequent page (ie 'is this address the same as the address in section 5?') if that makes sense?! Sorry I should have made that clear. Thank you for your reply! :)  
Michael ClarkMichael Clark replied 1 year ago

Maybe some conditional logic?

Put fields to be pre-filled with values from the other fields in a section, put conditional logic on the section"

"If checkbox is not blank, then show", if checkbox is whatever value.." all conditions, not any condition.

All the fields will display if the checkbox is checked. Could use radio buttons, instead. Might work better.

Could also use logic to skip a page, if need be. Put the blank address fields on a page different from the copied fields, skip the copied fields page if the addresses are different.

Just a couple thoughts. Good luck!

Karen Robinson answered 1 year ago
Hi Michael! Yes I understand where you're coming from, a good idea, I will see if I can use conditional logic. Thank you so much for your input, I really appreciate it! I'll let you know how I get on :) 
Michael ClarkMichael Clark replied 1 year ago

Great, Karen! Keenly interested on your progress. Hope you can keep us posted. It's a bit of a time consuming and potentially tedious-feeling effort, but I've found that the outcome is often worth that effort. "The juice is worth the squeeze," if you will. 🙂

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right