The maxchecked and minchecked tags are used with multiselect questions and tables to enforce a maximum or minimum number of selections, respectively. Validations are built in to ensure respondents cannot select more than the maximum or less than the minimum.
set list: GENRES
randomize: y
1. Rap / hip-hop
2. Rock
3. Classical / Jazz
4. Pop
5. Funk / R&B / Soul
6. Bluegrass
7. Country
8. Blues
1. Which music genres do you enjoy listening to the most?
instructions: Select <b>up to 3</b>.
type: checkbox
maxchecked: 3
randomize: y
optsfrom: GENRES
2. Which genres would you enjoy seeing live?
instructions: Select <b>at least 2</b>.
minchecked: 2
type: checkbox
optsfrom: GENRES
Details
- The
maxcheckedandmincheckedtags can be applied to checkbox and listbox questions and tables. - The
maxcheckedandmincheckedtags accept a single numeric input. This input can be a number or a question reference which contains a numeric value as its input. - Ranges can be specified by including bothÂ
maxcheckedandmincheckedon the same widget, though it is more efficient to use thenumcheckedtag to specify a range. - If a respondent selects the maximum number of responses specified with a
maxcheckedtag, all other responses will be disabled. Respondents can deselect responses to choose new ones. - Include the
instructionstag to clearly communicate how respondents should answer questions with these tags.
Additional examples
Referencing previous questions
maxchecked and minchecked can reference previous questions or variables. In Q6, the maximum number of selections a respondent can make depends on their answer to Q5 ('$Q5').
5. How many vehicles does your household have for personal use?
type: integer
range: 1-10
6. Which vehicle model(s) does your household drive?
instructions: Select up to $Q5.
type: checkbox
maxchecked: $Q5
1. Ford
2. Chevrolet
3. Toyota
4. Honda
5. Nissan
6. Jeep
7. Hyundai
8. Kia
9. Mazda
10. Volkswagen
91. Other {autoother: y; placeholder: Specify}
Restricting the number of responses in tables
When maxchecked and minchecked are applied to tables, the tag will apply to all rows (or columns in a vscale table). In T3, respondents can select up to three options per row. Unselected options will be disabled once the max is reached.
3. Which types of activities would you be interested in trying in these locations?
type: checkbox table
instructions: Select up to 3 per row.
maxchecked: 3
randomize: y
1. Visiting a museum
2. Touring a historic location
3. Attending a local sporting event
4. Attending a concert / play
5. Visiting a winery / brewery / distillery
rows:
1. New York
2. Boston
3. Los Angeles
4. Chicago
Setting different maximums or minimums per row
To set different maximums or minimums per table row, use maxchecked or minchecked on each row within a start table widget. Separate answer options and rows with an empty line.
start table: 4
introduction: How do you like these fish prepared?
type: checkbox
1. Sushi
2. Grilled
3. Poached
4. Baked
5. Pan-seared
1. Salmon
minchecked: 3
instructions: Select at least 3.
2. Tuna
minchecked: 2
instructions: Select at least 2.
end table
Comments
0 comments
Please sign in to leave a comment.