Forum
Pass form information to second form
I have a current client site that I would love to use perch on. My only hesitation is that they have a complicated form situation. They have a lead generating form that is split across 2 pages, the homepage and a second page. The homepage is https://www.normandyins.com/index.html. They have a form with 2 fields that passes the information to the next page and prepopulates those fields in the next form.
For example the homepage form: Name and Email
Pressing 'continue' button records this form as a submission and passes the information via the url to the next page where name and email are pre populated. The person then fills out a longer form without having to fill out his name and email again.
It was done this way so that my client can still capture information from people who don't fill out the second page.
Is there a way to do this with perch and how?
Hello Sara,
I think you can do this with Perch.
If you add the second page link to the
action
attribute in your form tag, you should be able to get the data on the page you specify. The Forms app should still record the submission as long as you add it to theapp
attribute.On the second page you can check whether you have the data with
$_POST
orperch_post()
:And you can pass the data into your second form template with:
In the form template you can pre-fill the name and email fields with the
value
attribute if you have the data:Docs:
Forms will actually auto-fill from any posted field with the same name. So if your second form has hidden fields to duplicate those from the first, they'll be filled automatically and be submitted with the second form.