1

Newbie here. I'm building a wordpress site with a custom form submission. I'd like to learn how to pass form values from one form to another form. UI attached.

FORM 1 FORM 1

FORM 2 FORM 2

The first form asks for specific values and when submitted is passed on to another page with the values chosen already loaded up. I can't seem to find an example as to how to do this. Can somebody help me? Thanks!

1
  • You can use `Multi step contact form 7' addon. Commented Mar 25, 2017 at 6:04

1 Answer 1

1

You have several options:

  1. Make the form a Single Page Application; ie, have all the steps of the forms on a single page (like tabs). Basically, it is all just one form which will only get submitted at the end.

  2. Store the intermediate form results on the browser's localStorage. Check if there is something in the localStorage and pre-fill the form. The complete response is only sent to the server at the end.

  3. Store the intermediate form results in the server. This means that after each step the partial response is stored and the next steps builds up from this. You can do this if the next step heavily depends on the previous step and you cannot make it a Single Page Application (SPA).

For options 1 and 2, you can dynamically pre-fill form inputs using javascript, for option 3, the form inputs will come pre-filled from the server.

Sign up to request clarification or add additional context in comments.

4 Comments

hi! so basically, I need the two forms to be on separate pages. The first form gets filled up by the user and gets it's PRICE updated by the chosen option for BEDS, BATHROOMS and FREQUENCY. This comes with a list of prices that are of different values. I made my research and these are the things I am planning to do. 1) Store Prices on an Array, 2) Update the Price asynchronously from the Prices stored. 3) Pass the values to another page. The thing is I do not know how to implement these 3. Do you know of any resources that could help me build the code for these? Thanks for your help!
By the way, I made the BEDS and BATHROOM options as <select> tags and the FREQUENCY as <input type="radio">
It is difficult to suggest specific implementation detail without understanding you current system, but a quick search shows there are many WordPress plugins to provide this functionality.
You could create two pages of form: the first one has a form with a get action for the next page. The second page reads the response to the first form and prepares the second form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.