APIs & Integrations

Loriauna
Member | Diamond Partner
Member | Diamond Partner

Issue with Custom Coded Form Embed Codes

Hi all,

 

I was wondering if HubSpot may have recently updated their forms API?

 

All of our customized embed codes that would redirect based off of specific criterias (i.e. redirect a certain industry selection to a specific meeting link upon form submission) are no longer working.

 

I am getting the following error in the console:

image (3).png

 

Here's an example of the code:

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "na1",
portalId: "12345678",
formId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
onFormSubmit: function($form) {
var contactType = $form.find('select[name="contact_type"]').val();

setTimeout(function() {
if (contactType === "Small Business Owner" || contactType === "Deal Service Providers") {
window.location.href = "https://www.google.com";
}
}, 500);
}
});
</script>

 

0 Upvotes
1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Issue with Custom Coded Form Embed Codes

Hey there! The Developer Changelog will be your best bet to look for updates or breaking changes. That being said, I do not see a breaking change to the forms endpoints.

 

Best,

Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes