SOLVED

Re: Forms - selecting a limited number of options

Go to solution
James_Glavin
Level 5

Hi there,

Has anyone found a way of setting up a form and having a multiple choice question which allows the lead to choose a limited number of options? i.e. Here's a list of 10 things, choose three.

Any ideas how this could work?

Thanks,


James

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator
17 REPLIES 17
Mrigesh_Gaurav
Level 1

Were you able to find a solution for this? We also have a similar requirement where we want users to only be able to select their top 3 choices from many options. Tried searching for Sanford Whiteman​s solution but no luck so far.

Any help would be really great.

Thanks,

Mrig

SanfordWhiteman
Level 10 - Community Moderator

I can find it for you later.  To be clear about the UX, you want people to select 3 choices, but what happens if they try to click a 4th?  (Recommendation: you disable the remaining checkboxes then they have reached their max.)

Robb_Barrett
Level 10

Does it allow them to uncheck a box and make a different selection?

Robb Barrett
SanfordWhiteman
Level 10 - Community Moderator

Of course!

I'd say the 2 interpretations of "maximum number of choices" are would be [a] disable remaining checkboxes if they have the max checked or [b] let them keep re-selecting past 3 and automatically unselect the -- first? last? -- one they checked.  [a] is less surprising behavior IMO.

SanfordWhiteman
Level 10 - Community Moderator

Demo here: MktoForms2 :: Checkboxes Max Checked

Related (but not completely congruent) discussion here: https://nation.marketo.com/message/107000#comment-107000

Ravi_Ansal2
Level 6

Hi Sanford Whiteman​,

I was trying to embed this code but stuck with the cssselectors.

cssSelector: '#IsTestContact__c, #Email_was_deleted__c, #ContactReq__c',

Please let me know how to find the Css Selectors in my form. Below is the form i have restrict leads to select not more than 3 options.

<script src="//app-sj04.marketo.com/js/forms2/js/forms2.min.js"></script>

<form id="mktoForm_1845"></form>

<script>MktoForms2.loadForm("//app-sj04.marketo.com", "023-STC-548", 1845);</script>

Thanks is advance.

SanfordWhiteman
Level 10 - Community Moderator

On that particular form the checkboxes are:

     INPUT[type="checkbox"][name="veniceRMUSuggestedTopics"]

Thomas_Belnap
Level 1

If you don't specify the name, will it set the limitation across all fields with checkboxes?

SanfordWhiteman
Level 10 - Community Moderator

The checkbox groups are dictated by standard CSS selectors, so you can create any groupings you want. You do need to have an entry in the checkboxGroups array for each group.

If all the fields are all within a Checkboxes field you can target them like:

LABEL[for="YourFieldName__c"] ~ .mktoCheckboxList INPUT[type="checkbox"]

Ravi_Ansal2
Level 6

Thanks Sanford Whiteman​, It worked

SanfordWhiteman
Level 10 - Community Moderator

Can I get a Correct Answer?

Ravi_Ansal2
Level 6

Hi Sanford Whiteman​,

I cant do that. I just posted my question in the thread. But surely request James Glavin to do so.

Thanks For the Help!!

Mrigesh_Gaurav
Level 1

This is so much helpful. We are going to try it out. Thank you!

Josh_Hill13
Level 10 - Champion Alumni

Do you want it to do something special?

You can def do a set of checkboxes, but you may need to do more javascript if you want it to do 3 only. Use SurveyMonkey instead.

James_Glavin
Level 5

Depends what you mean by special

We do want to use the answers they choose in sales alerts and other campaigns, so I'd love to keep it within Marketo if possible.

SanfordWhiteman
Level 10 - Community Moderator

Search my recent posts -- too busy to do the search right now -- to see where someone asked about using independent checkboxes (i.e. indie lead fields) but having a minimum/maximum number of overall selections.  I demonstrated how to do this with a little JS.

Josh_Hill13
Level 10 - Champion Alumni

Well, SM integration would keep it in Marketo, but it's expensive.

You would need a field for every single response in this case. You could do a multi select too I suppose, but I don't like using those in Marketo because it ends up as a single text with semi-colon separator. Gets messy.

You will still need javascript to control how many boxes they are allowed to check.