Embedded form clears prepopulated fields on focus/submit

New Member

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.

Reply
0 Upvotes
3 Replies 3
New Member

@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.

Reply
0 Upvotes
New Contributor

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.

Reply
0 Upvotes
Highlighted
Community Manager

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.

Reply
0 Upvotes