Set a limit on multi-select options
Use custom javascript to limit users to their top e.g. 5 options
If you want to limit people's selections to a multi-select question, you can do so following the instructions below:
Go to your Survey Pages screen at https://www.formjoy.com/survey_pages
Click 'Edit settings' for the relevant survey
In the Custom JavaScript section, add the code provided below, with a few updates:
Set the maxCheckboxes variable to whatever limit you want to place (e.g. 5)
Replace QUESTION_SLUG on line 4, with the checkbox question slug from your NationBuilder survey
If you wanted to do this for multiple checkboxes, you would need to duplicate rows 3-12 of the code above, and update the variable names of:
maxCheckboxes
checkboxes
checkedCheckboxes
I.e. if you had a multiselect question asking people their preferred news sources, and another asking them their most important policy issues, your code might look like the below. You would again need to replace NEWS_QUESTION_SLUG and ISSUES_QUESTION_SLUG with the relevant question slugs:
Last updated