Have an idea?

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

Number of Checks at runtime

I want a numeric box to count the number of checkbox selected as soon as a check box is clicked.

This is similar to “Total” box which show sum of all the values entered.

I have a question which have 40 options and respondent needs to select top 10 responses. The counter helps respondent to keep a track of number of responses he have selected till now.
asked Nov 14, 2012 by anonymous

2 Answers

0 votes
You can set the maximum number of responses to 10 which will prevent the respondent from proceeding.

With regards to the counter, you will need some JavaScript. I'm not your best option regarding this script sorry.
answered Nov 14, 2012 by Paul Moon Platinum (69,330 points)
0 votes
There is a JavaScript function called SSI_CustomGraphicalCheckbox that gets run every time a graphical check box is clicked. Using JavaScript you can provide your own instructions specifying what should happen when a box gets clicked. So if your question name is "q1" and your total box has an id of "total" then you can do something like


function SSI_CustomGraphicalCheckbox(GraphicalCheckboxObj, InputObj, blnCheck) {

  var i = 0;
  var sum = 0;
  for (i = 1; i <= 40; i++) {
    sum += parseInt(SSI_GetValue("q1_" + i));
  }

  document.getElementById("total").value = sum;

}



to show the total number of boxes checked.
answered Nov 14, 2012 by Jeff Forkner Bronze (2,875 points)
...