Have an idea?

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

2 column can not zero both

Q1 Grid Numer , there are 10 rows and 2 columns.

                           Column 1        |        Column 2                  
Row1 -    Input Number   |    Input Number    ==> Column 1 and Column 2 can not choose zero both.
Row2 -    Input Number   |    Input Number   ==> Column 1 and Column 2 can not choose zero both.
.........
Row10 -    Input Number   |    Input Number    |   Input Number   ==> Column 1 and Column 2 can not choose zero both.

Is it possible? Please detail.
asked Jan 28 by Saroeun Bronze (1,340 points)

1 Answer

0 votes
You have to apply a validation to check if sum of both columns is zero.  

for (var r = 1; r <= 10 && !strErrorMessage; r++) {

    Q1check=0;
    for (var c = 1; c <= 2 && !strErrorMessage; c++) {
        
        Q1check = Number(SSI_GetValue('Q1_r' + r + '_c' + c))+Q1check;
     
    }
     if ((Q1check==0)) {
            strErrorMessage = 'Error in '+r+" row";
        }
        else
        {
            strErrorMessage = "";
        }
       
}
answered Jan 28 by TarunKhanna Bronze (730 points)
edited Jan 28 by TarunKhanna
Hi TarunKhanna,

I have tested, it can not work and always show error "Error Row 1".
So you have solution?

Regard,
Vanna
Hi Vanna,

Can you please confirm if you have a fixed list of 10 brands or you are using any constructed list in this question.

Best
Tarun
...