Block non-business emails from Webflow forms

Publié le 9 September 2022 - Mis à jour le 17 October 2023 - Écrit par Fabien Manent

Do you want to block non-business emails from your Webflow forms, such as Gmail, Yahoo or Hotmail? You can create a list of domain names to block.

Block non-business emails with Finsweet, in 3 steps

Finsweet offers "Hack #18" to do this. The principle is simple. It adds JavaScript code to your page that blocks non-business emails.

Step 1, copy and paste the code

Copy and paste the JavaScript code below into the before </body> tag area of the page on your Webflow site that contains the form.

Step 2, choose the addresses to block

Now choose the domains to block, for example Gmail, Yahoo or Hotmail.

In the line const invalidDomains = ['AJOUTER-ICI'], replace the value "AJOUTER-ICI" with the domain name you want to block.

To block Google addresses, for example, replace "AJOUTER-ICI" with "gmail.com". Do the same for the other domains.

Step 3, identify the form elements

The JavaScript code now needs to recognize the submit button and the field where users enter their email address on the form page.

To do this, proceed as follows:

  • Add the CSS class .hack-button to your form's submit button.
  • Add the class .hack18-email to your form's email field.

You're done. You now know how to block non-business emails from your Webflow forms.

[FAQ]

The questions we get asked before signing

‍

Are your resources free?

Yes. Articles, videos, ebooks and our tool selection are freely available.

Some ebooks simply ask for your email address so we can send them to you.

Can you help us set up a tool featured here?

Yes, as part of a project or the weFlow retainer. We can set up things like these.

  • Integrations.
  • Automations.
  • Tracking.
  • New features.

Tell us what you want to do, and we'll tell you if there's a simpler way. Contact us.

Can we suggest a topic for an article or video?

Yes, and that's often how our best content starts.

Send us your question through the contact page. If it's relevant to other marketing teams, we'll answer it in an article or a video.

How does Ouiflow's free audit work?

You share your site's address and you get the audit within 7 days. It covers 5 topics.

  • The technical health of the site.
  • Your current rankings.
  • High-potential pages.
  • Blocking errors.
  • Your visibility in AI engines.

The team reviews and comments on it, with a list of concrete priorities. It's free and with no commitment. Request your audit.

Spend 30 minutes with an expert, not a salesperson.

We look at your site, your stack and your goals, then tell you what we would do, even if it's not with us. No sales pitch.