I’ve created a multi-step form in Webflow containing two pages:
Step 1: /get-started Step 2: /get-started-final
For get-started, I’ve added the following code before the tag
<script>
Webflow.push(function() {
$('form').submit(function() {
setTimeout(function() {
location.href = 'https://websitedomain.com/get-started-final?email=' + $('#emailget').val();
}, 100);
});
});
</script>
This page is the first page of the form input and only asks for name and email.
Now for Get Started Final , I ask for 4 additional fields, but I also want to pull the email from the URL and add it to a hidden form field in Get Started Final.
<script>
function getParameterByName(url) {
if(!url) url = window.location.href;
var matches = url.match(/[\?|\&]?email=(.+)/)
if (!matches[1]) return '';
return decodeURIComponent(matches[1]);
}
Webflow.push(function() {
$('#emailget').val(getParameterByName('email'));
});
</script>
What is wrong with my code?
Here is my site Read-Only: LINK
(how to share your site Read-Only link)