Hi Jack. I believe your code wont work if 1 or more option is not selected in your select question. This is because the variables for that particular row wont get created in the grid question. Therefore, your JavaScript code would fail. I'm assuming that your rows are coming from a constructed list and columns are fixed. There are two ways of doing this.
The easier way -
if ([% ListHasParentMember(forGridQ,1) %] == 1)
{
if (SSI GetValue ("S4_r1_c1") == SSI GetValue("S4_r1_c2"))
{
strErrorMessage = "You can't select the same country as 'Main' and 'Secondary'.";
}
}
Where forGridQ is the constructed list in which the selected items of select question are coming(Press F1 in SSI and search for the explanation of this function). Repeat the above code for n number of rows.
There is one more method of doing this using arrays. Let me know if you are interested, I will post that too!
Thanks.