Global Form Event Listener for HubSpot Forms (JavaScript)
This is to record a conversation from the HubSpot Developer Slack regarding the question in the title. Not in the developer slack? Join it here
Josh Saunders [9:18 AM] Different question, does anyone know how I can change the value of a hidden form field based on what page the form is on? Have 50 pages that need to use the same form, but need a hidden field to set a contact property based on what page they submit the form on. We're using the HubSpot CMS and I don't see anywhere in the form module or form embed code to change the hidden field. What's the easiest way to set a hidden form field? Or do I have to create a module to insert in all the pages and use HUBL and JS to build my own front-end form and POST it to the API? (I'm not even sure how or if you can make API requests in a HubSpot module). Any direction would be greatly appreciated!