I'm trying to implement HubspotForm into my SAP. It render's but when I click submit button I get error "The onFormSubmit function in hbspt.forms.create requires jQuery. It was not run." How can I force this?
My component:
import React from "react"
import style from "./bottomForm.module.sass"
import BackgroundImage from "gatsby-background-image"
import classNames from "../../helpers/classNames"
import HubspotForm from "react-hubspot-form"
import { graphql, useStaticQuery } from "gatsby"
const BottomForm = ({ image, title, children }) => {
const defaultImage = useStaticQuery(graphql`
query {
form_bg: file(relativePath: { eq: "common/form_bg.jpg" }) {
childImageSharp {
fluid(maxWidth: 1920) {
...GatsbyImageSharpFluid_noBase64
}
}
}
}
`)
return (
<BackgroundImage
Tag="section"
className={style.section}
fluid={image || defaultImage.form_bg.childImageSharp.fluid}
id={"bottomForm"}
>
<div className={style.content}>
<h2 className={style.title}>{title}</h2>
<div className={style.form_box}>
<div className={classNames(style.form_column, style.form_info)}>
{children}
</div>
<div className={style.form_column}>
{/*<div id="contactFormBottom" />*/}
<div className={style.form_contact_box}>
<HubspotForm
portalId="9075801"
formId="6ee5300e-5ffe-471d-a400-92b06ca18a11"
onSubmit={() => console.log('Submit!')}
onReady={(form) => console.log('Form ready!')}
loading={<div>Loading...</div>}
/>
</div>
</div>
</div>
</div>
</BackgroundImage>
)
}
export default BottomForm