APIs & Integrations

sabari
Member

Using data from form field in the redirect url on form submit

Hello All,

I’m currently developing a website in HubSpot and I have been having some issues with Forms.

When a user enters a value and submits the form, I want to use the value from the form field in the redirect URL.

For example, a user enters some value X in the field (say the property is “value”) and submits the form, the user should be redirected to a URL with the value X in the end.

example jquery code for the above function: ‘window.location.href = ‘https://app.example.com/score/’ + X;’

PS. I’m new to web development. Can you make the answer as simple as possible? Thanks!

0 Upvotes
2 Replies 2
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Using data from form field in the redirect url on form submit

Hi @sabari,

The following topic has a few different suggestions for how to add form fields as query parameters on the redirectUrl:

I need to embed a HS form on an external (not CoS) website. And when the user submits the form, the redirect URL needs to include form fields as parameters. Is this possible? We figured out a way of doing this on a CoS landing page using a native HS form, but it was pretty tricky. In this case, I need to embed the form on an external page rather than use a CoS page. What I'm trying to accomplish is capture the lead's info (name, company, email) and then pass that info off to a scheduling a…

0 Upvotes
sabari
Member

Using data from form field in the redirect url on form submit

Hello @Derek_Gervais,

Thank you for your help. I’ll look into it!