The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Make required field "either/or"

Labels

This Discussion is public

Notifications

I'm using a form to collect customer data and I want to make it so that the user cannot submit unless they enter a phone number into the phone number field OR an email into the email field.  Is there a way to make the fields required but in an "either/or" option.  So if they enter a phone number the e-mail field is not required or if they enter an e-mail then the phone number field is not required?

You have to use custom code to achieve this type of validation. If you want to write it in PHP, you can use the frm_validate_field_entry hook: https://formidableforms.com/knowledgebase/frm_validate_field_entry/#kb-conditionally-require-a-field

You can also handle this kind of validation at the browser level with jQuery, which may be the easier way to do it.

Discussion closed.