# Include form fields as redirect URL parameters on an embedded form

**URL:** <https://community.hubspot.com/t/include-form-fields-as-redirect-url-parameters-on-an-embedded-form/11901>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [April 3, 2017, 11:29pm UTC](https://community.hubspot.com/t/include-form-fields-as-redirect-url-parameters-on-an-embedded-form/11901 "2017-04-03T23:29:39Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![robertainslie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/robertainslie/32/1875_2.png) [@robertainslie](https://community.hubspot.com/u/robertainslie)\
**Post date:** [April 5, 2017, 1:01pm UTC](https://community.hubspot.com/t/include-form-fields-as-redirect-url-parameters-on-an-embedded-form/11901/17 "2017-04-05T13:01:39Z")

</div>

Hi [@Lloyd\_Silver](https://community.hubspot.com/u/lloyd_silver),  
Another way to do this is by re-running the hbspt.forms.create method of the embed code on change to each field and recreating the redirectUrl, appending each field. This changes the context and rebuilds the form on each call. @derekcavaliero 's method is probably better, but there are multiple ways to proceed.

That method looks like this:

hbspt.forms.create({  
portalId: ‘[hub\_id]’,  
formId: ‘[form\_guid]’,  
redirectUrl:‘[https://www.domain.com/page’](https://www.domain.com/page%E2%80%99),  
target:’#target-node-for-form-build’  
});

In your JS, recall that entire method on change to each field, creating a redirectUrl like:  
redirectUrl:‘[https://www.domain.com/page?firstname=Lloyd’](https://www.domain.com/page?firstname=Lloyd%E2%80%99). Be sure to include the ‘target’ node so the embed code knows where to rebuilt the form each time.

---

_[View the full topic](https://community.hubspot.com/t/include-form-fields-as-redirect-url-parameters-on-an-embedded-form/11901)._
