Home  >  Q&A  >  body text

Is it possible to submit a hubspot form via js?

I have a HubSpot form embedded in my HTML site, but since it doesn't quite match the site design, I'd like to hide it. I want the form to be submitted by clicking a normal HTML button. How can I do this?

P粉557957970P粉557957970205 days ago359

reply all(1)I'll reply

  • P粉810050669

    P粉8100506692024-03-29 10:50:23

    Yes, this is possible. Hubspot has extensive documentation at your disposal. I think what you are looking for is Submit form data.

    Their forms API is REST-based, meaning you can communicate with them via stateless HTTP requests. This means you only need to call their endpoint when you want to submit the form (e.g. using fetch()).

    Since you mentioned not liking the form design, there is a field in their API that allows attaching CSS classes to form elements. You can try using custom CSS to customize your form. (https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options)

    reply
    0
  • Cancelreply