We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Jul 12, 2021 5:17 AM
Hey,
I am trying to attach shopping cart from my React App to my HubSpot form, but so far unsuccessfully.
I am using react-hubspot-form package as my form provider.
If I do onSubmit={() => console.log(cart)} it passes the values just fine, but to actually recieve the values with the form I tried to create hidden field/ticket in my form and attach the cart to it, but I am not sure how to handle it in react.
JavaScript with jQuery would look like this:
onFormSubmit={function($form { jQuery( 'input[name="TICKET.content"]'.val(cart).change()}}
While content is ticket property name and cart is my react property that includes all products added to cart.
Is it possible to achieve what I need with react-hubspot-form? Does anyone has experience with it?
Jul 13, 2021 10:00 AM