Created
August 27, 2019 17:54
-
-
Save JacobLett/6873b222370936329f398f2af52559dc to your computer and use it in GitHub Desktop.
hubspot form data to url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js" charset="utf-8"></script> | |
<!--[endif]----> | |
<script type="text/javascript" src="//js.hsforms.net/forms/v2.js" charset="utf-8"></script> | |
<script> | |
hbspt.forms.create({ | |
portalId: "47251", | |
formId: "f4271808-e089-439e-80f8-13d61a039b3a", | |
inlineMessage: 'Your submit message here', | |
onFormSubmit: function($form){ | |
setTimeout( function() { | |
var formData = $form.serialize(); | |
alert(formData); | |
window.location = "https://google.com?" + formData; | |
}, 250 ); // Redirects to url with query string data from form fields after 250 milliseconds. | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment