Do you want to blacklist some email domains?
The idea is when users enter an ****@gmail.com
or ****@hotmail.com
or *****@facebook.com
for example, they will not pass the validation process.
For this, you need to add a pattern to the Email field. Just click it and scroll the popover.
In Pattern add the following string.
[a-z0-9._%+-]+@(?!(?:live|gmx|yahoo|outlook|msn|icloud|facebook|aol|zoho|yandex|lycox|inbox|myway|aim|goowy|juno|(?:hot|[gy]|google|short|at|proton|hush|lycos|fast)?mail)\.\w+$)[a-z0-9.-]+\.[a-z]{2,4}
For example, this pattern allows you to restrict multiple free domains, including gmail, outlook and facebook. But you can update it to include other domains too. Just add a pipe with the domain name (Eg. “|spammer”) after “facebook”.
That’s all!
This is the error message you will see during the Client-Side validation:
And this is the error message you will see during the Server-Side validation:
If you want to customize the server-side validation error messages, you can get our Premium Add-On: Custom Error Messages.