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?
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.
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.