APIs & Integrations

Igor1
Member

Embedded form clears prepopulated fields on focus/submit

I’m working on embedding a form. Embedding itself works fine and form submits without a hitch. What I’m having an issue with is prepopulating some of the fields.

Per tutorial, I set a fields value with either of:

  1. $(‘input[name=“phone”]’).val(‘123321’).change();
  2. $(‘input[type=“email”]’).prop(‘value’, "mail@mail.com").change();

Values appear fine on form load but when such field get a focus or form is submitted those these prepopulatted values get cleared. Manually entered values are working as expected.

I’ve tried setting value several times in a row, focus’ing and blur’ing input before that to mimic user interaction, adding timeout to delay value assign and finally making an empty barebons html page with only required js to exclude any potential conflicts. No luck.

5 Replies 5
UMancic
Participant

Embedded form clears prepopulated fields on focus/submit

Still having this issue. Is there any news on will it be solved anytime soon?

 

BFrancisco
Participant

Embedded form clears prepopulated fields on focus/submit

@Derek_Gervais Do you have any updates? We are having the same issue in our organization and is stoping us from auto-filling email fields which are extremely important for us

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Embedded form clears prepopulated fields on focus/submit

Hey all,

 

I'm seeing this issue too. From what I've been able to identify so far, it seems like it's only happening for forms that use a default style template. In general, embed code customization isn't supported for these forms, so it's possible that the issue exists in the interplay between the embed code function(s) and the default style template.

 

Regardless, I'm working on this with my team, and I'll update this thread with more information when I have it.

domino-dseno
Member | Partner
Member | Partner

Embedded form clears prepopulated fields on focus/submit

Hello, I am in the same situation since last Friday.

I have already written a topic about this, where I propose a temporary solution.

Let me know if you guys find a better and cleaner fix.

0 Upvotes
Siddharth_Shukl
Member

Embedded form clears prepopulated fields on focus/submit

@Igor Same here. The hubspot support really need to improve on the documentation. This one is not working at all: http://developers.hubspot.com/manipulating-forms-with-jquery.

I am trying to set intervals so that the value remains. But I am looking for a simpler approach.

0 Upvotes