SOLVED

In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

Go to solution
Danielle_Wong
Level 8 - Community Advisor

In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

I have a form where I need the below questions answered, but only one of them is required.

Training Session A

  • Day 1
  • Day 2
  • Day 3
  • Day 4

Training Session B

  • Day 1
  • Day 2
  • Day 3
  • Day 4

I don't want to make both of these fields required, because we don't want them to have to choose a day in both sessions. Just one of them. What's the best way to do this while still having the two questions exist?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

What about making them both required and having in each one a picklist value that shows "I'm going to the other session" and then have the value submitted be blank?

Training Session A

  • Day 1
  • Day 2
  • Day 3
  • Day 4
  • I'm going to Training Session B

Training Session B

  • Day 1
  • Day 2
  • Day 3
  • Day 4
  • I'm going to Training Session A

Just a thought

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

What about making them both required and having in each one a picklist value that shows "I'm going to the other session" and then have the value submitted be blank?

Training Session A

  • Day 1
  • Day 2
  • Day 3
  • Day 4
  • I'm going to Training Session B

Training Session B

  • Day 1
  • Day 2
  • Day 3
  • Day 4
  • I'm going to Training Session A

Just a thought

Anonymous
Not applicable

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

Another option if you are using the same field would be to have it all in one question with all the picklist values:

  • Training Session A, Day 1
  • Training Session A, Day 2
  • Training Session A, Day 3
  • Training Session A, Day 4
  • Training Session B, Day 1
  • Training Session B, Day 2
  • Training Session B, Day 3
  • Training Session B, Day 4
Danielle_Wong
Level 8 - Community Advisor

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

Thanks Anita for sharing this idea. I will probably use this method if I can't get it to work the way I want.

SanfordWhiteman
Level 10 - Community Moderator

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

What's the best way to do this while still having the two questions exist?

Like this: MktoForms2 :: Require One from <SELECT> Group

Danielle_Wong
Level 8 - Community Advisor

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

Thanks so much for sharing this sample code, Sanford! I will give this a try.

Danielle_Wong
Level 8 - Community Advisor

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

So, I added additional radio button options to two of my fields, saved it, approved and clicked preview. but the new radio button options I added are not showing up. I even went in an undid my changes and redid them and previewed it, and it's still not showing up. I took a 2 hour break thinking maybe Marketo is lagging or something and still not showing my updates!

I see the form and options correctly when I'm editing the form. But when I click preview, the changes are not there. Anyone experience this before? This sort of thing WOULD happen to me! Thanks

Danielle_Wong
Level 8 - Community Advisor

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

Screenshot when editing form:

editing.jpeg

Screenshot in preview:

preview.jpeg

SanfordWhiteman
Level 10 - Community Moderator

Re: In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered?

You have to approve the form and re-approve the Marketo LP.

Also note that if you mark both of these fields as required ​at the Form Editor level​ then that will always take precedence over custom validation rules. If you look at my example, the required ​logic is done in JavaScript in order to work across different fields (think of it as a "virtual field group").