APIs & Integrations

Taehwan
Member

cssClass not working in v2 Form API

I want to customize the embedded form's styling. As you can see from this link (https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options), the hubspot form API support 'cssClass' but is not working. 

 

An reproducible link is this (https://codesandbox.io/s/hubspot-embedded-form-apis-cssclass-not-working-example-u02xb?file=/src/App...). The css class ('is-not-working') is not appended anywhere. Please check out this link, and let me know when and how to 'cssClass' is appended to element in iframe. and I want to know how to modify style in iframe's element.

0 Upvotes
1 Reply 1
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

cssClass not working in v2 Form API

Hi @Taehwan ,

 

The form that you are loading has HubSpot form styling being applied. This creates an iFrame instead of a raw HTML form. In the form editor, you can set it to 'Set as Raw HTML Form' under the 'Style & Preview' tab. 
Could you check if that solves your issue?

According to the docs you could also pass an empty string to the cssRequired param.

  window.hbspt.forms.create({
    region: "na1",
    portalId: "20361262",
    formId: "e90b67d9-c688-4fad-b494-3672e17fb4a5",
    cssRequired: "",
    cssClass: "is-not-working"
  });


Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.