Problems with hubspot script url

I have a form in my page that registers users and used the hubspot script url to save data from my form in this form I have an input like this

email: Yup.string()

.email(

t(‘shared:form.errors.emailField’, {

name: t(`register:registerPage.emailInput`),

})

)

.required(

t(‘shared:form.errors.requiredField’, {

name: t(`register:registerPage.emailInput`),

})

)

.test(

‘is-corporate-email’,

t(‘shared:form.errors.invalidCorporateEmail’),

(value: any) => {

if (!value) return false

const domain = value.split(‘@’)[1]

return domain && !blockedDomains.includes(domain.toLowerCase())

}

),
the problem is that the hubspot script save the contact even if it have a domain that is blocked I already block that domains on Never log domain list
how can I block this domains for the hubspot script

Hi! @POchoa6
You could use a hidden input that only appears or is set when the domain is allowed.

<input type="hidden" name="valid_submission" value="true" />

HubSpot can pick up that field, and later you can segment or ignore contacts that don’t meet this flag. Then in HubSpot, use workflows or filters to ignore contacts missing that value; not perfect, but adds an extra layer.

Hi @POchoa6

If you’re syncing contacts to your backend or using HubSpot APIs, you can also block contact creation on the server side by checking the email domain before syncing.

Or you can conditionally show the next input options i.e., you can make your form progressive but only on valid emails which you want.

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!