You’re trying to carry a submitted email address from one Webflow form to another later in the user journey. If your current script returns “undefined,” it likely fails to correctly store or retrieve the email value. Here’s how to do it using localStorage in the browser.
tag section of your Page Settings on the first page (the form confirmation or thank-you page works too).
name
or id
:<script> document.addEventListener("DOMContentLoaded", function () { var form = document.querySelector("form"); if (!form) return; form.addEventListener("submit", function () { var emailField = form.querySelector("input[type='email']"); if (emailField && emailField.value) { localStorage.setItem("user_email", emailField.value); } }); });</script>
<script> document.addEventListener("DOMContentLoaded", function () { var savedEmail = localStorage.getItem("user_email"); var emailField = document.querySelector("input[type='email']"); if (emailField && savedEmail) { emailField.value = savedEmail; } });</script>
querySelector("input[type='email']")
to something more specific (e.g., input#signup-email
or input[name='email']
).user_email
.Store the email in localStorage on the first form’s submission, then read and inject it in the second form during page load. Make sure your selectors are correct and that you're not testing within Webflow’s Designer Preview (localStorage only works across real page loads).