I’m trying to pass a value through a form field via the embed code, along with doing a custom redirect. I see the documentation says to use OnFormSubmitted for the redirect, but this seems to work fine, not sure if it’s needed:
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js">
</script>
<script>
hbspt.forms.create
({ region: "na1",
portalId: "XXXXXX",
formId: "XXXXXX-XXXXXX-XXXXXX-XXXXXX",
redirectUrl: "https://www.redirectgoeshere.com/"
});
</script>
But I’m stuck on passing the value - I have only found threads discussing passing values based on form inputs which isn’t necessary for my case. The field is called recent_asset_id.
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js">
</script>
<script>
hbspt.forms.create
({ region: "na1",
portalId: "XXXXXX",
formId: "XXXXXX-XXXXXX-XXXXXX-XXXXXX",
redirectUrl: "https://www.redirectgoeshere.com/",
recent_asset_id: "test"
});
</script>
Any help appreciated