Skip to content

Instantly share code, notes, and snippets.

@JacobLett
Created August 27, 2019 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JacobLett/6873b222370936329f398f2af52559dc to your computer and use it in GitHub Desktop.
Save JacobLett/6873b222370936329f398f2af52559dc to your computer and use it in GitHub Desktop.
hubspot form data to url
<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