Home › Forums › Front-end Issues › Validate email domain › Reply To: Validate email domain
The only thing I see in your code that might be an issue is that you should have === false as == will match 0, but this would only happen if they entered @domain.com without an address.
if( is_string($value) && strpos($value, '@domain.com') === false ) {
What type of field is this? I’m assuming it’s a text field, what I mean is, is it a sub field of another field like a group field? If it is try using the field key instead of the field name.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.