1. Home
  2. Integrations
  3. Sign-up form widget
  4. HubSpot forms

Add email validation to HubSpot forms forms

For HubSpot forms that appear on the page itself, add the widget to your page's footer HTML or your own site's footer. It then checks the email field before the form is sent. Forms that load in an iframe are out of its reach.

Before you start

You need to add custom HTML to the page: a HubSpot page's footer HTML, or your own site's footer if the form is embedded elsewhere.

Setup

  1. On a HubSpot page open the page's Settings, then Advanced options, and find Footer HTML. If the form is embedded on another website, add the snippet to that site's footer instead.
  2. Paste the snippet below and save, then publish the page.
  3. Load the page. If your form fields are inside an iframe, you will see no hint; see the limits below.
  4. Open the published page (not the editor preview) and type jane@gmial.com into the field. You should see a suggestion to use gmail.com under it. Try x@mailinator.com to see the disposable-address error.
footer code
<script src="https://simpleverifier.com/widget.js" defer></script>
<script>
  // Turns the widget on for every email field on the page, including fields the builder adds later.
  function svAttachAll() {
    if (!window.SimpleVerifier) return;
    document.querySelectorAll('input[type="email"]').forEach(function (input) {
      SimpleVerifier.attach(input);
    });
  }
  document.addEventListener("DOMContentLoaded", function () {
    svAttachAll();
    new MutationObserver(svAttachAll).observe(document.body, { childList: true, subtree: true });
  });
</script>

Limits on HubSpot forms

  • A browser script cannot look inside an iframe from another domain. If your HubSpot form is embedded as an iframe, the widget cannot see it.
  • HubSpot checks the email format and can block free email domains itself; the widget adds typo suggestions and disposable-address checks on top.
  • To clean contacts already in HubSpot, use the HubSpot integration, which verifies them with the API.
  • Blocking a submit relies on the browser's own form validation. If a builder sends the form with its own script instead, the hint under the field still appears but the form may go through, so test on the published page.

Check that the mailbox exists

The widget checks format, typos, throwaway domains and role addresses in the browser. It cannot tell whether a mailbox exists, because that needs an API key and anything in a web page can be read by visitors. For that, call the API from the server that receives the form. See the API docs, the full form widget page with Node, PHP and Python examples, and pricing.

Related: HubSpot integration.

Common questions

Does it work on HubSpot hosted landing pages?
It can, when the form is rendered into the page rather than an iframe and you can add footer HTML. Test on the published page.
How is this different from the HubSpot integration?
The HubSpot integration verifies contacts already in your CRM with the API. The widget catches mistakes on the form before they become contacts.
Does the widget replace HubSpot's own validation?
No. It adds to it. HubSpot's rules still run.
Is the form widget free?
Yes. The widget runs in the visitor's browser, needs no account or API key and has no usage limit. Checks that confirm the mailbox exists use the SimpleVerifier API from a server, which comes with Pro, Business and Agency, from $39/month.

All form platforms · All integrations

Clean your next list before it bounces

100 free email checks when you sign in with Google, no card. Then monthly plans from $9, or one flat price with fair use, never cut off.

100 free checks, no card Cancel anytime Secure payment by Stripe