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.

Require one of two fields

  1. Tell It Media
    Member

    I'd like to require either a phone number or an email address on a form, but not necessarily both. It would be nice to have conditional logic that would require an entry on at least one field in a specified set of fields.

    Posted 11 years ago on Thursday August 11, 2011 | Permalink
  2. Would take a bit of coding, but you could probably use the Gform Validation filter to accomplish that.

    Posted 11 years ago on Thursday August 11, 2011 | Permalink
  3. Tell It Media
    Member

    Hmm. I'll give that a look. Thank you.

    Posted 11 years ago on Thursday August 11, 2011 | Permalink
  4. Did you figure out how to do this? I need this functionality

    Posted 11 years ago on Monday November 28, 2011 | Permalink
  5. You could do this but only as a customization using the gform_validation hook as @Michelle mentioned above. There is a tutorial on the gform_validation hook here:

    http://www.gravityhelp.com/documentation/page/Using_the_Gravity_Forms_%22gform_validation%22_Hook

    That tutorial isn't specific to this implementation, it's merely a tutorial with an example on how to use the gform_validation hook to implement custom validation. You would have to write custom code specific to your validation use case.

    Your custom code would go in your themes functions.php file or you would create a custom plugin using your code and then activate it on your site.

    Posted 11 years ago on Monday November 28, 2011 | Permalink