In my form, how can I make a set of 2 questions required, but only need 1 of the 2 answered? | Community
Skip to main content
Danielle_Wong
Community Manager
December 1, 2017
Solved

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

  • December 1, 2017
  • 3 replies
  • 3455 views

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

Best answer by

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

3 replies

Danielle_Wong
Community Manager
December 4, 2017

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
Community Manager
December 4, 2017

Screenshot when editing form:

Screenshot in preview:

SanfordWhiteman
New Participant
December 4, 2017

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").

SanfordWhiteman
New Participant
December 2, 2017

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
Community Manager
December 4, 2017

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

Accepted solution
December 1, 2017

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

December 1, 2017

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