How Do I Prepopulate a Form Field Based On Previous Page Input?
In this scenario, say you have a newsletter signup form on your homepage with one single email field to fill out. On submit of this field you would like the user to be sent to a new page with a slightly longer form to fill out. However, you don’t want them to have to fill out their email again.
The following solution uses url parameters to send the data where it needs to be on the new page.
Form HTML
Send form data to new page with url parameters:
JavaScript
On load of new page use url parameters to update the value of the correct fields: