# Programmatically form redirect without jQuery (onFormSubmit)

**URL:** <https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [August 8, 2020, 8:30pm UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961 "2020-08-08T20:30:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ballonura](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ballonura/32/77019_2.png) [@ballonura](https://community.hubspot.com/u/ballonura)\
**Post date:** [August 8, 2020, 8:30pm UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/1 "2020-08-08T20:30:29Z")

</div>

There is anyway to do programmatically redirect the same form across multiple pages without require jQuery lib?

Like this solution just without jQuery:

[https://community.hubspot.com/t5/Content-Strategy-SEO/Creating-a-download-or-e-book-download/td-p/35430](https://community.hubspot.com/t5/Content-Strategy-SEO/Creating-a-download-or-e-book-download/td-p/35430)

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 11, 2020, 2:52am UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/2 "2020-08-11T02:52:33Z")

</div>

Hey @ballonura,

Do you mean that after the visitor submits the form, you’d like to redirect it to another page?

If so, you can set it under the options form settings:

 ![30154i86486C4F984C5082.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/6/e6dd16a040d2819e10a502057e26961d64f1f758.png)

---

<div class="post-metadata">

**Author:** ![ballonura](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ballonura/32/77019_2.png) [@ballonura](https://community.hubspot.com/u/ballonura)\
**Post date:** [August 11, 2020, 6:12am UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/3 "2020-08-11T06:12:53Z")

</div>

I want use the same form accross multiple pages, but on each page, after submit redirect to different place.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 12, 2020, 5:36am UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/4 "2020-08-12T05:36:27Z")

</div>

Hey @ballonura,

Can I check if these pages are HubSpot hosted pages? If yes, you can set different redirect page on the same page for different pages by setting it on the form module: [Redirect a form submission on an offer page to gated content or a thank you page](https://knowledge.hubspot.com/forms/redirect-a-form-submission-on-an-offer-page-to-gated-content-or-a-thank-you-page).

If you’re using non-HubSpot form, the only way to set different redirect on different pages for the same page, is to use the [How to customize the form embed code](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options).

---

<div class="post-metadata">

**Author:** ![ballonura](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ballonura/32/77019_2.png) [@ballonura](https://community.hubspot.com/u/ballonura)\
**Post date:** [August 12, 2020, 6:35am UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/5 "2020-08-12T06:35:24Z")

</div>

Hey @WendyGoh,

They non-Hubspot hosted pages, only HubSpot forms that embedded on my site.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 13, 2020, 5:14am UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/6 "2020-08-13T05:14:37Z")

</div>

Hey @ballonura ,

If you’re using a non-HubSpot hosted pages, your team would have to use either the [How to customize the form embed code](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options) or [Using Global Form Events](https://legacydocs.hubspot.com/global-form-events) to set up the redirect.

---

<div class="post-metadata">

**Author:** ![ballonura](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ballonura/32/77019_2.png) [@ballonura](https://community.hubspot.com/u/ballonura)\
**Post date:** [August 13, 2020, 8:41am UTC](https://community.hubspot.com/t/programmatically-form-redirect-without-jquery-onformsubmit/23961/7 "2020-08-13T08:41:31Z")

</div>

The @WendyGoh. For everyone interest, here is the non-jQuery solution:

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Freference%2Fcms%2Fforms)**

Good day. :manhappy:
