Javascript with Hubspot forms

Hi!

I added a hubspot form with two input fields (email and code). After pressing a button, a small JavaScript file should be executed that generates a URL using the input values (e.g. Example Domain) and should redirect the user to this generated URL. Any ideas how I can aAdd a javascipt file to that form?

Many thanks,

Cornelia

You can add automation after the form is submitted (and a contact is created). In this new workflow, you can send a webhook to your URL. Here, you can choose the request method (GET or POST) and add the needed fields from the new contact.
But, as I right remember, you should have OperationalHub for that.

Hi @CLahnsteiner ,

You could customize the embed form where you can write your logic in the `onFormSubmit` event. That way, you can capture the input values and write a simple script to redirect the user to a new page. Make sure to use an inline thank you message for the form to prevent the user being redirected by HubSpot.

Here is a great example from another post: https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/Form-redirect-based-on-property-selection/m-p/522732
However, if you have content or marketing Hub Pro, there is also a beta available that might allow you to set this up without having to code this: Create and customize forms