# Javascript Redirect Based on a Form Selection (Before Submitting)

**URL:** <https://community.hubspot.com/t/javascript-redirect-based-on-a-form-selection-before-submitting/71305>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [December 15, 2022, 3:36pm UTC](https://community.hubspot.com/t/javascript-redirect-based-on-a-form-selection-before-submitting/71305 "2022-12-15T15:36:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OSid](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@OSid](https://community.hubspot.com/u/OSid)\
**Post date:** [December 15, 2022, 3:36pm UTC](https://community.hubspot.com/t/javascript-redirect-based-on-a-form-selection-before-submitting/71305/1 "2022-12-15T15:36:57Z")

</div>

I am looking to redirect users to a different page (for an academic account) based on them making that selection in a Hubspot from field.

This ideally would happen onchange and occur as soon as it is selected instead of happening on a form submission.

ID: license\_type\_of\_interest-cb1da23a-da50-42f8-b281-b8845c18b0a6  
value: Academic License

Attempted to get it by Id, match the values to “Academic License” and if that is the value to redirect to a new url immediately. Also, unfortunately using Wordpress and Hubspot forms.

Select Snippet: [

Website

]([https://www.olansgz.com/](https://www.olansgz.com/))

```auto
<select id="license_type_of_interest-cb1da23a-da50-42f8-b281-b8845c18b0a6" required="" class="hs-input" name="license_type_of_interest">
 <option disabled="" value="">Please Select</option>
 <option value="Silver License">Silver</option>
 <option value="Gold License">Gold</option>
 <option value="Enterprise License">Enterprise</option>
 <option value="Academic License">Academic</option>
 <option value="Researcher License">Researcher</option>
</select>

```

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 16, 2022, 12:15am UTC](https://community.hubspot.com/t/javascript-redirect-based-on-a-form-selection-before-submitting/71305/2 "2022-12-16T00:15:39Z")

</div>

Hi, @OSid 👋 Welcome to the community! Let’s see if we can get the converstaion going. Hey, @Kevin-C @LeeBartelme, do you have any thoughts here?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![Kevin-C](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kevin-c/32/34570_2.png) [@Kevin-C](https://community.hubspot.com/u/Kevin-C)\
**Post date:** [December 16, 2022, 12:25am UTC](https://community.hubspot.com/t/javascript-redirect-based-on-a-form-selection-before-submitting/71305/3 "2022-12-16T00:25:16Z")

</div>

Hey @OSid

take a look at the [global form events.](https://legacydocs.hubspot.com/global-form-events)  
what you could do is when the for is ready attach your change event listeners.
