APIs & Integrations

Nutan_Singh
Member

Custom onFormSubmit not working

SOLVE

I m using hubspot form but I want to write my custom code on form submit but form's default onformsubmit is working instead of my 'onFormSubmit'. I want to execute my code on form submission.
hbspt.forms.create({
portalId: "2916234",
formId: "fcc5528d-a708-4f28-a507-9ace1920044f",
onFormSubmit: function(){
console.log('triggered');
},
inlineMessage: ' '
});

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Custom onFormSubmit not working

SOLVE

Welcome, @Nutan_Singh!

Are you trying to modify the onFormSubmit function on this page?

If so, it's not possible to modify the embed code of a HubSpot form implemented through HubSpot's native form widget. You will have to embed the form in a custom HTML module instead.

If you're referring to a different page, could you share a link so that I can run some tests?

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
1 Reply 1
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Custom onFormSubmit not working

SOLVE

Welcome, @Nutan_Singh!

Are you trying to modify the onFormSubmit function on this page?

If so, it's not possible to modify the embed code of a HubSpot form implemented through HubSpot's native form widget. You will have to embed the form in a custom HTML module instead.

If you're referring to a different page, could you share a link so that I can run some tests?

Isaac Takushi

Associate Certification Manager
0 Upvotes