Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Add a numeric column (age) in a multi-select Grid question.


I have a multi-select Grid question (Q1) with 3 columns.

People can select 0, 1 ,2 or 3 checkboxes per row.

I would like to add an additional column (before the 3 columns) for Age (0 - 17 max).

The age value should  be required if they tick any of the 3 options in a row, but not required if a row has no options selected.

Is that possible?

asked Mar 3, 2021 by dan r Bronze (4,645 points)

1 Answer

0 votes
You'll need to use two grid questions, the first non-required numeric with one column and the second checkbox with three columns.  You can combine the two of them with the code here:


Then give the first grid question this custom JavaScript verification:

var secondGrid = $('#[% QuestionName() %]_div').nextAll('.grid').get(0).id.replace(/_div$/, '');
var secondGridColumns = $('input[name="hid_col_list_' + secondGrid + '"]').val().split(',');
$('input[name="hid_row_list_[% QuestionName() %]"]').val().split(',').forEach(function(row){
    if (!SSI_GetValue('[% QuestionName() %]_r' + row + '_c1')) {
            if (SSI_GetValue(secondGrid + '_r' + row + '_c' + column)) {
                strErrorMessage = 'your error message...';
answered Mar 3, 2021 by Zachary Platinum Sawtooth Software, Inc. (214,575 points)
Thanks Zachary, I'll get on with trying to implement this and report back
Update.....Works perfectly , thank you Zachary