We had an interesting challenge this week - using hidden fields in a non-HubSpot Form. Usually we embed HubSpot forms in websites to make it easy to control. But in this case the website was all custom bespoke code with forms on hundreds of pages.
We wanted the hidden field to populate a Custom Property in the Contact Record to trigger a Workflow. The data in the field is dynamically generated so it wasn’t practical to create custom forms for each page.
If you add a hidden field to a non-HubSpot Form then HubSpot will ignore it when parsing the form data.
So, what we did was add a normal Text Input Field - with a dynamically populated default value - then hid the field with CSS (display: none).
HubSpot then parses the data in the field and updates the contact property. The visitor doesn’t see another potentially confusing field and we only had to make one code change.
Hope this helps you.
Mike