By clicking on “Accept all cookies”, you agree that cookies may be stored on your device in order to improve site navigation, to analyze the use of the site and to contribute to our marketing efforts. Check out our privacy policy for more information.

Block unprofessional e-mails from Webflow forms

Illustration image 3D shapes

Wondering how to block unprofessional e-mails from Webflow forms such as Gmail, Yahoo or Hotmail? It s possible to create a list in which certain domain names are blocked.

Finsweet, in 3 steps

Finsweet s "Hack #18" will help you achieve this goal. But how does it work? Finsweet simply adds Javascript code to block unprofessional e-mails.

Step 1: Copy and paste

The first step is to copy and paste the Javascript code below into the tag named "before </body> tag", in the page of your Webflow site where your form and the unprofessional e-mails to be blocked are located.

Step 2: Select the addresses to block

Now you need to choose which addresses to block. Gmail? Yahoo ? Hotmail ? ...

Simply replace the value "ADD-ICI" on the line "const invalidDomains = [ ADD-ICI ]" with the domain name you wish to block.

For example, if you wish to block e-mails from Google addresses, replace "ADD-ICI" with "gmail.com". And so on for other addresses!

Step 3: Identify the functionality

Now that the code has been created, the Javascript code needs to be able to identify not only the submit button, but also the field where the e-mail address is entered on your form page.

How do we do this?

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

And you re done! You now know how to block unprofessional e-mails from your Webflow forms.