Passing email from newsletter form input to a pop-up Pardot form (where the email is pre-populated based on the Webflow newsletter input)

Hi!

I’m a developer adding hardcode for a client site. I’m looking to have a simple newsletter popup form that first asks for the user’s email, and then the user selects “Subscribe”, and then a modal pops up with another form (a Pardot form) asking some more questions, where the email is pre-populated.

For example here’s the email input form:

And then what will happen is the user will click “Subscribe” and a Pardot form will pop up with the email they entered already populated. I’m a little confused because I’m not quite sure how to integrate both so that the email will pre-populate on the Pardot form.

Thanks so much!


Here is my site Read-Only:
https://preview.webflow.com/preview/tii-test-project-5dc351ad7efdbc2469bf5a?utm_medium=preview_link&utm_source=designer&utm_content=tii-test-project-5dc351ad7efdbc2469bf5a&preview=8388ca069399ccfeebb84275a77e7f58&mode=preview

You can use JavaScript code for it. In the below code, replace <pardot-form-id> with the ID of Pardot form HTML element where you want to copy the email. This code should be copied to the “custom code” section of the Webflow page settings.

$("#test").click(function(){
    var email = $("#Email-Footer-2").val();
    $("#<pardot-form-id>").val(email);
});

I keep getting ‘undefined’ for some reason

Can you post link of your published site? The read-only site link does not run JavaScript.

Sure, https://tii-test-project-5dc351ad7efdbc2469bf5a.webflow.io/ there it is!

As of right now, the email input value just keeps coming up as undefined and I can’t figure out why