SOLVED

Re: Making a form field conditionally required

Go to solution
Bonni_Graham_Go
Level 2

Making a form field conditionally required

Good morning Hive Mind!

We have a form where our SalesOps group wants two fields:

* Email

* Phone

They want to set it up so that one or the other is required, but AT LEAST one must be filled out. That is, if someone fills out Email, they don't have to fill out Phone and vice versa, but ONE of the two fields must have a value. How would we do that?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Making a form field conditionally required

On the form side, this is easy to do.

 

But before I tell you how, I want to sound a warning that may make you rethink the concept.

 

If you submit a form without an empty Email Address field, Marketo will create a new lead with no email. Marketo will never dedupe on Phone, so each time the form is submitted with the same phone number will create a duplicate. Are you 100% sure this is what you want?

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Making a form field conditionally required

On the form side, this is easy to do.

 

But before I tell you how, I want to sound a warning that may make you rethink the concept.

 

If you submit a form without an empty Email Address field, Marketo will create a new lead with no email. Marketo will never dedupe on Phone, so each time the form is submitted with the same phone number will create a duplicate. Are you 100% sure this is what you want?

Bonni_Graham_Go
Level 2

Re: Making a form field conditionally required

RIGHT; in the churn of the argument about this, had forgotten that. Let me go back to SalesOps and point this out, which may change the game. TY!

Tags (1)
LukeG
Level 1

Re: Making a form field conditionally required

Hi Sanford, 

 

Was the solution for the conditionally required form fields ever shared with the community? We have another use case that would potentially benefit from your insight with this topic. 

 

Thank you! 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Making a form field conditionally required

Alas that blog post is in my Drafts along with tens of others. If you’re adventurous there’s working code here:

 

MktoForms2 :: VRs and Dynamic 'Required'

LukeG
Level 1

Re: Making a form field conditionally required

Looks great! Thank you!