Commerce Tools

ACampbell61
Member

Payment link Form only prepopulates email field, none other

SOLVE

If I place the embed code from a Payment link on my external site, only the email field prepopulates from query string parameters. You can see I have modified the embed code to insert the values for email, firstname and lastname. Only email prepopulates.

 

<!-- Start of Payments Embed Script -->
<div class="payments-iframe-container" data-src="https://app.hubspot.com/payments/HIDDEN?referrer=PAYMENT_LINK_EMBED&layout=embed-full&email=someone@..."></div>
<script type="text/javascript" src="https://static.hsappstatic.net/payments-embed/ex/PaymentsEmbedCode.js"></script>
<!-- End of Payments Embed Script -->

 

Is there a solution to this?

0 Upvotes
1 Accepted solution
Jnix284
Solution
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Payment link Form only prepopulates email field, none other

SOLVE

@ACampbell61 I'm not sure it's a bug, versus a missing feature, ideas are the formal way of requesting an improvement. If you have a paid subscription, you could try submitting a ticket to HubSpot Support to see if they can provide further insight on the functionality and escalate the request.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

View solution in original post

7 Replies 7
ACampbell61
Member

Payment link Form only prepopulates email field, none other

SOLVE

EDIT: I'm assuming the javascript was relying on this attribute to auto populate the fields, but perhaps it's not working in a different way.

Looking into this further, in the HTML markup that hubspot renders for payment links, only the email field has the `autocomplete="email"` attribute on the `input` tag.

E.g:

 

<input autocomplete="email" data-test-id="email-address-input" type="text" aria-labelledby="UIFormControl-label-2" required="" aria-required="true" id="UIFormControl-1" class="form-control private-form__control vr-hidden private-form__control--on-dark" value="someone@example.com">

 


The other fields do not have the `autocomplete` attribute set correctly. (This is the firstname field).

 

<input data-test-id="custom-form-field-input" name="firstname" type="text" aria-labelledby="UIFormControl-label-6" required="" aria-required="true" id="UIFormControl-5" class="form-control private-form__control private-form__control--on-dark private-form__control--error" value="" aria-invalid="true" aria-describedby="UIFormControl-5-validationMessage">

 


It looks like this could be solved at your end fairly easily. You should add the `autocomplete` attribute to any Contact and Company field that are added to a Payment Link in the editor.

ACampbell61_0-1710499544534.png

 



BérangèreL
Community Manager
Community Manager

Payment link Form only prepopulates email field, none other

SOLVE

Hi @ACampbell61,

Thank you for asking the Community!

First, I'd like to share these articles that might help you:

- Auto-populate form fields with a query string
- Add the embed code to an external page or custom module
- Understand pre-populated form fields

I have also found similar threads that might be of interest and point you to the right direction:

- The solution from @karstenkoehler on this post "Auto populate form fields for a specific contact or company"
- The solution from @coldrickjack on this post "Issues with getting form to pre-populate once embedded on website"
- The solution from @karstenkoehler on this post "pre-filled forms"

I also wanted to invite a couple of subject matter experts to this conversation: Hi @karstenkoehler, @Jnix284 and @alyssamwilie do you have suggestions to help @ACampbell61, please?

If anybody else has anything to add and/or share, please feel free to join in the conversation 🙂

Thank you and have a lovely day!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


0 Upvotes
Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Payment link Form only prepopulates email field, none other

SOLVE

Hi @ACampbell61 can you please share the full data-src URL using the insert code option so we can see how all of the form fields are configured in the parameters?

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
ACampbell61
Member

Payment link Form only prepopulates email field, none other

SOLVE
https://app.hubspot.com/payments/mZtbSrrX?referrer=PAYMENT_LINK_EMBED&layout=embed-full&email=someone@example.com&firstname=Frank&lastname=Test


That is a test payment link, the fields `firstname` and `lastname` are the internal names of the contact object properties.

Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Payment link Form only prepopulates email field, none other

SOLVE

Thanks @ACampbell61, it looks like you found the source of the issue with the payment link form - that the autocomplete input is missing. 

 

I suggest adding the details you shared as an idea here so others can upvote and it can reach the product team.

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
ACampbell61
Member

Payment link Form only prepopulates email field, none other

SOLVE

Hi - yeah I'm not so sure, the autocomplete attribute is actually instructions to the browser that it's ok to autocomplete a previously entered email address, and not specific to Hubspot javascript code. It might just be a coincidence I noticed that.

Given this is more of a bug than an idea - is there a more direct way to get support here?

0 Upvotes
Jnix284
Solution
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Payment link Form only prepopulates email field, none other

SOLVE

@ACampbell61 I'm not sure it's a bug, versus a missing feature, ideas are the formal way of requesting an improvement. If you have a paid subscription, you could try submitting a ticket to HubSpot Support to see if they can provide further insight on the functionality and escalate the request.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin