Streaming live at 10am (PST)

Blocking gmail.com emails from form submissions

Is there a way to require form submissions to NOT use personal email addresses (those from gmail.com, outlook.com and other domains)?

I am getting a lot of spam even with Recaptcha. They all are coming from gmail.com or outlook.com domains.

Thanks

Hi Andrey, welcome to the forum :webflow_heart:

You will have to use custom code for that.
Something like that:

<script type="text/javascript">
    $(document).ready(function(e) {
        $('#submit-button-id').click(function() {
            var email = $('#email-field-id').val();
            var reg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)(?!yahoo.co.in)(?!aol.com)(?!abc.com)(?!xyz.com)(?!pqr.com)(?!rediffmail.com)(?!live.com)(?!outlook.com)(?!me.com)(?!msn.com)(?!ymail.com)([\w-]+\.)+[\w-]{2,4})?$/;
            if (reg.test(email)) {
                return 0;
            } else {
                alert('Please Enter Business Email Address');
                return false;
            }
        });
    });
</script>

Hi Aviv,

Thanks for your help.

Can this code be added in the Webflow UI (I am not developer)?

Perhaps via the Custom Attributes section in the text field setting of the email form…

Thanks, Andrey

@akisselev, this code can be placed on the page where your form is at or under the custom code section of your Page Settings.

This would not be an attribute on the form. Since you are specifically telling the form to reject certain email extensions.

Hope that helps,
Brandon

1 Like