Have an idea?

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

Javacscript error message

I have a grid question with three rows called "sc6"
The columns are Yes, No, Don't Know.
If the respondents says "no" to all three rows, I'd like them to get an error message. This is my script, but it doesn't work. Any idea what I'm doing wrong?
if (SSI_GetValue('sc6_r1') == 2 && (SSI_GetValue('sc6_r2') == 2 && (SSI_GetValue('sc6_r3') == 2 {
    strErrorMessage = 'Please select Yes for at least one row.'; }
asked Aug 20, 2020 by ChristineCarll (370 points)

1 Answer

0 votes
It looks like you mismatched ().  Try this.

if (SSI_GetValue('sc6_r1') == 2 && SSI_GetValue('sc6_r2') == 2 && SSI_GetValue('sc6_r3') == 2)
{ strErrorMessage = 'Please select Yes for at least one row.'; }
answered Aug 20, 2020 by Jay Rutherford Gold (42,810 points)
UGH! How'd you see that?! I guess I was too close. Works like a charm. THANK YOU!!!!!
Lol, no worries, glad to help.  I can't tell you how many times I've made that mistake so I look for it right away. You pretty much had it though!