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
Dec 1, 2017 9:22 PM UTC
Solved

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

Accepted solution
Dec 1, 2017 9:57 PM UTC

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

8 replies

Danielle_Wong
Community Manager
Dec 4, 2017 6:53 PM UTC

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

Translate
Danielle_Wong
Community Manager
Dec 4, 2017 6:55 PM UTC

Screenshot when editing form:

Screenshot in preview:

Translate
SanfordWhiteman
Level 10
Dec 4, 2017 8:52 PM UTC

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

Translate
SanfordWhiteman
Level 10
Dec 2, 2017 7:48 AM UTC

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

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

Translate
Danielle_Wong
Community Manager
Dec 4, 2017 3:21 PM UTC

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

Translate
Accepted solution
Dec 1, 2017 9:57 PM UTC

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

Translate
Dec 1, 2017 10:00 PM UTC

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
Translate