APIs & Integrations

tif_nee
Participant | Gold Partner
Participant | Gold Partner

Prefill a hidden field from the embedded form code on an external website

Hi all,

 

I have a form embedded on an external website and would like to set a variable/hidden field on form submission. I have a custom field already setup for a contact. In short, upon submission I want this field prefilled by a variable I'm setting at the embed code. The embed code is static so I'll be able to add the variable per instance. Basically I want to create my own version of the pageID variable used internally on HS landing pages.  Any ideas how I can accomplish this?

 

Thank you!

2 Replies 2
mii
Contributor | Platinum Partner
Contributor | Platinum Partner

Prefill a hidden field from the embedded form code on an external website

@Jaycee_Lewis Same here...

...external Page and Form submit without hidden fields. As well as trouble with prefilled visible fields on external pages. This time Wordpress. Any easy HubSpot or JavaScript solution, that dosen't require a full API implementation is welcome.

@hubspot I don't see any reason why hidden fields should be blocked for external pages?! You don't expect that. And it is nowhere documented. It is definitely an exclusion criterion against using hubspot.

Possible Solution: Make sure Form is set to unstyled HTML on external page, otherwise it's an iFrame and can't be prefilled with JavaScript.

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Prefill a hidden field from the embedded form code on an external website

Hi, @tif_nee 👋 Thanks for the interesting question!

 

Hey, @DanielSanchez @Gonzalo @Mark_Ryba do you have any insight or thoughts on how @tif_nee can approach this challenge?

 

Thank you very much! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes