Hi, I am trying to use hidden fields in a hubspot form which is embedded in a hubspot CTA. (an exit popup with a form). What is the best way to update these hidden values? Within forms can you add a callback on form create but as far as I see there is no possibility to do this for CTA's/popups?I want to update the hidden values of the form using javascript since the data I need is within the dataLayer/dom outside of Hubspot.
@christoph88 I agree! The pop-up CTAs is still a very new feature, so the product team are actively trying to improve on this. I'd definitely recomend adding this as a feature request to them through the HubSpot ideas forum here.
Tom Mahon Technical Consultant | Solutions Engineer | Community Champion Baskey Digitial
Did my post help answer your query? Help the community (and me) by marking it as a solution.
Hi, I am trying to use hidden fields in a hubspot form which is embedded in a hubspot CTA. (an exit popup with a form). What is the best way to update these hidden values?
Within forms can you add a callback on form create but as far as I see there is no possibility to do this for CTA's/popups? I want to update the hidden values of the form using javascript since the data I need is within the dataLayer/dom outside of Hubspot.
Hey @christoph88 this isn't currently possible within CTA forms. HubSpot forms allows you to access the embed code so you can add in your own callbacks in here, they also populate with URL query strings. I'm not sure if pop-up forms populate with query strings, I doubt it but I haven't tried on the new embed for pop-ups yet, it might be worth testing!
Regarding the callbacks and embed code however, this isn't currently possible as the pop-up embed is injected on page load through the tracking code. So there's no form embed code to edit your callback into. They also use pretty dynamic IDs from what I've seen and the pop-up forms load within an iframe, so you can't pass anything to the DOM of it.
Tom Mahon Technical Consultant | Solutions Engineer | Community Champion Baskey Digitial
Did my post help answer your query? Help the community (and me) by marking it as a solution.
The query parameters work in CTAs but aren't useable in my usecase. I really find this a lacking feature. Having those hidden fields available would make the forms 100x more powerfull.
@christoph88 I agree! The pop-up CTAs is still a very new feature, so the product team are actively trying to improve on this. I'd definitely recomend adding this as a feature request to them through the HubSpot ideas forum here.
Tom Mahon Technical Consultant | Solutions Engineer | Community Champion Baskey Digitial
Did my post help answer your query? Help the community (and me) by marking it as a solution.
Hi @christoph88! Welcome to the Community-- happy to have you here 😊
I understand your goal is to pre-populate hidden fields on a pop-up form with data from outside of HubSpot using javascript. This sounds similar to how you can auto-populate form fields on a page by adding query strings to the page URL (Knowledge Base article), but we have a layer of complexity assuming these fields would be populating dynamically, correct?
Could you describe an example use case of these values? That additional context may help us find a resolution!
One of our experts @TomM2 gave some insight on this similar post, so I recommend checking out that thread for some added value!
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !