Make required field "either/or"


This Discussion is public


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:

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

Reply to this Discussion