PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Email validation - allow only one domain?

  1. shelzmike
    Member

    Love the plugin btw. Okay, so I am creating an 'Employee of the Month' nomination form that will be used on one of our company-only (essentially intranet) sites that I use WP and Gravity forms on.

    I have it virtually hidden from public - i.e. users will only find it if they know the address; however, I decided to only divvy out logins for the 5 or so managers that will be actually adding content. I did not want to have to work on setting up and maintaining records for another 150 logins on top of all the others that we have.

    So, I do not want the employees to have to log in to complete the form. However, I do want at least a 'soft' level of protection from SPAM (it could always happen), etc. I want to do this by allowing only people to post who use a specific domain I give them. So, how can I go about validating the email address so that a.) yes it is valid all the way around, but also b.) it is in fact the one and only domain that is allowed?

    Thanks!

    Mike

    Posted 12 years ago on Tuesday April 17, 2012 | Permalink
  2. Hey Mike, not going to lie, you lost me halfway through this one! lol

    However, you can use this hook for custom validation:
    http://www.gravityhelp.com/documentation/page/Gform_validation

    Posted 12 years ago on Tuesday April 17, 2012 | Permalink
  3. shelzmike
    Member

    Yeah, I tend to do that a lot...really bad habit of mine. :) And I came back here to post that I found that link that talks about the Gform_validation hook. Thanks!

    Mike

    Posted 12 years ago on Tuesday April 17, 2012 | Permalink
  4. Right on Mike, glad to help.

    Posted 12 years ago on Tuesday April 17, 2012 | Permalink
  5. shelzmike
    Member

    In case anyone is interested or stumbles upon this post, here is the pastie of how I actually got this working the way I wanted. The top part, of course, is the Gravity Validation hook, and the very bottom is what I added to allow whatever domains I wanted. I suppose another way could be to setup an array and then populate it with the allowed domains. Then just check against that.

    Either way, it works:

    http://pastie.org/3816641

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  6. Thanks for posting your solution Mike!

    Posted 12 years ago on Thursday April 19, 2012 | Permalink

This topic has been resolved and has been closed to new replies.