APIs & Integrations

OSid
Member

Javascript Redirect Based on a Form Selection (Before Submitting)

SOLVE

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

 

<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>
0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Javascript Redirect Based on a Form Selection (Before Submitting)

SOLVE

Hey @OSid 

 

take a look at the global form events. 
what you could do is when the for is ready attach your change event listeners. 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

0 Upvotes
2 Replies 2
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Javascript Redirect Based on a Form Selection (Before Submitting)

SOLVE

Hey @OSid 

 

take a look at the global form events. 
what you could do is when the for is ready attach your change event listeners. 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Javascript Redirect Based on a Form Selection (Before Submitting)

SOLVE

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

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes