Email form validation for webflow forms

Hi there,

I’m wondering if there’s an option within Webflow for Email Form validation in the forms?

Ie. instead of entering emails such as test@test.com, or personal emails from free domains such as hotmail, to only allow them entering work email addresses/valid email addresses when they enter their details?

Looking forward to your response.

Many thanks,
Alice

Here’s a script from KwesForms where you can validate email addresses based on domains. This script blocks gmail but you can add to it.

<script>
    var form = document.getElementById('myForm');
    var errorMessage = 'No Gmail accounts allowed!';

    form.addEventListener('kwCustomRulesSet', function () {
        window.setCustomKwRule(
            'myForm', 
            'email', 
            errorMessage, 
            function (value) {
                return value.indexOf('@gmail.com') > -1;
            }
        );
    });
</script>