Using onFormSubmit callback function on non embed webform


I have following two questions.

  1. I am not using Embed code for generating the webform. Is there any way that i can use onFormSubmit callback function in this normal form (i.e form created without using embed code). I want to call a customised java script before form submit.

  2. Is there any way by which i can add the webform embed code in the website page created by Hubspot.

The purpose of doing above two is that i want to post the data to URL before the form submission by using java script. But my form is not created by Embed code. Please suggest if there is any other way for this.


Hi @Digvijay_Singh,

What exactly do you mean when you say the form isn't created by the embed code? Is this a HubSpot form on a HubSpot page? Or is this an entirely external form? In general, if you're trying to post the form data to multiple locations, your best bet is to post the data to your own server and use the Forms API to send the submission to HubSpot. That enables you to do whatever processing you need on your end: