# 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:** 2

<div class="post-metadata">

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

</div>

You could achieve this by using the onFormSubmit callback and switching the form to use an inline message instead of a redirect (explained below).

```auto
hbspt.forms.create({
 portalId: 'xxxxxxxx',
 formId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
 inlineMessage: 'Your submit message here',
 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.
 }
});

```

Because you have access to the jQuery $form object inside the onFormSubmit listener you can serialize the forms data and append it to a url to redirect to after the form is submitted. **This only works if you have the inlineMessage set and disable the redirectUrl for the form.**

See if that helps you out.

---

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