Forums

Do not accept certain mail domains

senzaesclusiva 29 May, 2021
I have seen the video that explains how to validate email domains with Regex
https://www.youtube.com/watch?v=yK6CYsrMw3Y&list=PLNdPw6Bog3zcuSKs7NGNi8QPtfj5IsxQA&index=7

But how to do the exact opposite, i.e. deny those same domains?
Can the "Does NOT contain" field be useful, and if so, how do you enter multiple strings?
I don't know Regex, if someone can help me out with an example I would be very grateful.
GreyHead 29 May, 2021
Hi senzaesclusiva,

I've just looked at the video and it looks as if Does NOT contain should do what you need. The video example has multiple strings and I think the same format should work in the other box.

Bob
senzaesclusiva 29 May, 2021
Answer
Hy GreyHead
thanks for replay.

I've already tried entering in "Does NOT contain", multiple strings as per the example in the video, but it doesn't seem to work. I will try better and more carefully.

On the other hand, waiting to find the right and more robust solution, I tried to concatenate the strings as I do in Drupal CMS (I'm learning Chronoform on WP just to help a friend who is particularly bad at it).
Basically I put in "Does NOT contain": "gmail", "yahoo", "aol", "outlook" (and so on).
It seems to work: the field shows the error and the custom message, and if you submit, the form shows the error and blocks the submission.


I don't really trust series of strings put in a field; I'd prefer the opportunity to build an array, but for now it's fine.

Thanks again
Ed
You need to login to be able to post a reply.