Passing a hidden email value field from Hubspot Form to a thank you page
解決
I am looking for way to customize a form to pass the email field value onto a thank you page for tracking purposes after the form is submitted.
Using this form embed code to customize:
hbspt.forms.create({ portalId: '', formId: '', onFormSubmit: function($form) { // YOUR SCRIPT HERE } });
Currently when I hit submit on the form my thank you page url is not receiving the value and just shows email= {{contact.email}} instead of the actual email.
onFormSubmit: function($form){
setTimeout( function() {
var formData = $form.serialize();
window.location = "http://www.yoururl.com?" + formData;
}, 250 ); // Redirects to url with query string data from form fields after 250 milliseconds.
}
onFormSubmit: function($form){
setTimeout( function() {
var formData = $form.serialize();
window.location = "http://www.yoururl.com?" + formData;
}, 250 ); // Redirects to url with query string data from form fields after 250 milliseconds.
}