Have an idea?

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

Conditionally require row responses in a grid based on an earlier row

I have a grid with 4 rows. First row is Product Name, second is Product Description, then Price, then Quantity. Name and Description are text responses, and Price and Quantity are numeric.

There are 4 columns for respondents to fill in as many products as they offer.

Within each column, I need the survey to return an error if Product Name (r1) is non-blank and any of Product Description (r2), Price (r3), or Quantity (r4) are blank.

I've tried the following but it's not working. Any ideas?

if ((SSI_GetValue ("ImagingGrid_r2_c1") == "") && (SSI_GetValue ("ImagingGrid_r1_c1") != "")
{
var strErrorMessage = "If you indicated a product exists, you must fill in a description.";
}
asked May 12, 2015 by sdecarvalho18 (145 points)

1 Answer

+1 vote
Hi,

It seems, parameter mismatch issue here. Use below code, it should work.

if (((SSI_GetValue ("ImagingGrid_r2_c1")) == "") && ((SSI_GetValue ("ImagingGrid_r1_c1")) != ""))
{
var strErrorMessage = "If you indicated a product exists, you must fill in a description.";
}

answered May 12, 2015 by Rajesh Rana Gold (23,430 points)
Perfect! Thank you!!
...