Have an idea?

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

Grid with Exclusive

Question: How Important are the ff. Tools
A: Tool A - 1=not important 2 3 4 5 = very important
B: Tool B - 1=not important 2 3 4 5 = very important
C: Tool C - 1=not important 2 3 4 5 = very important
D: No Tools are benefitial.

This seems impossible for the Grid but when I select Free Format and create the button itself.  It wont let me pass because ABC are required. If I uncheck required then I need to manually code the verification part.
asked Jan 27, 2015 by Eugene

1 Answer

0 votes
Here is something I whipped up that should assist you. I just tested it and it operates okay.

I setup Q1 (grid question) and Q2 (select checkbox question) and saved them on the same page. No free format questions necessary here.

Q1 is a row direction grid with 3 rows - Tool A / Tool B / Tool C.
Q2 is a select question with 1 defined code - No tools are beneficial.

I unticked the "Require response" for both Q1 (all rows) and Q2.

I then inserted the following JavaScript into the Q1 "Custom JavaScript Verification" window (click on the Advanced button).
if (SSI_GetValue("Q1_r1")==0 && SSI_GetValue("Q1_r2")==0 && SSI_GetValue("Q1_r3")==0 && SSI_GetValue("Q2_1")==0)
 {
  var strErrorMessage="You must answer the question.";
 }

else if ((SSI_GetValue("Q1_r1")>0 || SSI_GetValue("Q1_r2")>0 || SSI_GetValue("Q1_r3")>0) && SSI_GetValue("Q2_1")==1)
 {
  var strErrorMessage="You must either rate each tool or select the checkbox.";
 }

else if (SSI_GetValue("Q2_1")==0)
 {
  var count=0;

  if (SSI_GetValue("Q1_r1")>0)
   {
       var count=count+1;
   }
  
  if (SSI_GetValue("Q1_r2")>0)
   {
       var count=count+1;
   }
  
  if (SSI_GetValue("Q1_r3")>0)
   {
       var count=count+1;
   }
  
  if (count<3)
  {
   var strErrorMessage="You must rate all tools if you are not selecting the checkbox.";
  }
 }

I have performed 3 checks ...

1/ If no responses have been selected for Q1 and Q2.
2/ If the Q2 checkbox has been selected and any of the Q1 grid rows have also been answered.
3/ If the Q2 checkbox has NOT been selected and NOT ALL of the Q1 grid rows have been answered.

I think that covers all angles.
answered Jan 28, 2015 by Paul Moon Platinum (55,825 points)
None of above
When Q2 have selected, i want all row in Q1 are in blank.
Is it possible? how could i do it?
...