# Issue with Custom Coded Form Embed Codes

**URL:** <https://community.hubspot.com/t/issue-with-custom-coded-form-embed-codes/96051>\
**Category:** APIs & Integrations\
**Tags:** developer, professional, forms\
**Created:** [December 13, 2023, 11:17pm UTC](https://community.hubspot.com/t/issue-with-custom-coded-form-embed-codes/96051 "2023-12-13T23:17:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loriauna](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@Loriauna](https://community.hubspot.com/u/Loriauna)\
**Post date:** [December 13, 2023, 11:17pm UTC](https://community.hubspot.com/t/issue-with-custom-coded-form-embed-codes/96051/1 "2023-12-13T23:17:34Z")

</div>

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](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/e/6e0d402d9c14d3e5a7e7ef58a2896616d30d9efa.png)

Here’s an example of the code:

\<script charset=“utf-8” type=“text/javascript” src=“[//js.hsforms.net/forms/embed/v2.js](https://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](https://www.google.com)”;  
}  
}, 500);  
}  
});  
\</script\>

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 14, 2023, 10:08pm UTC](https://community.hubspot.com/t/issue-with-custom-coded-form-embed-codes/96051/2 "2023-12-14T22:08:55Z")

</div>

Hey there! The [Developer Changelog](https://developers.hubspot.com/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
