Have an idea?

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

Javacscript error message

Hi,
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 by ChristineCarll (330 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 by Jay Rutherford Gold (37,705 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!
...