I am currently trying to update two hidden fields using Javascript. The two hidden fields utilize the name property, so I am using the getElementByName selector. I can get it to see the fields, and based on the console, it reports the value back as I’ve set it. However, when I look at the fields on Hubspot, none of the data comes through. Here is a breakdown of the script I wrote.
Hi, @TRowley Thanks for reaching out. Hey, @Anton@MatthiasWeber do you have any tips you can share with, @TRowley? I have a feeling we’ll need more context to get specific solutions, and any troubleshooting suggestions you can provide are greatly appreciated.
since forms are rendered with Hubl(server-side) and JS is loaded on client-side you can’t really control forms with JS by default. BUT you can create a custom module with a form function and a modified embed code from any form - doesn’t really matter and modify the form load by adding your script with onBeforeFormInit. Here’s the documentation about modifying forms.
This touches on something I’ll need to do, but as a complete Hubspot neophyte I need to ask first, how do I even get Javascript onto the page where the form is?