Have an idea?

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

How do I pre-select check-boxes or radio buttons in my questions?

I'm working in SSI Web 7 and would like to pre-select some graphical check-boxes or radio buttons on some of my questions. Here's my problem. First, I want to set the check-box in the first row and first column of a grid question to be on when the respondent first sees this page. Second, I want to pre-select a specific radio button in a select question. How do I accomplish these two tasks?
asked Sep 18, 2012 by JKincaid Bronze (805 points)
retagged Sep 18, 2012 by Walter Williams

1 Answer

+2 votes
Best answer
There is a little-known JavaScript function in SSI Web which was introduced in version 7 called SSI_SetSelect. It will allow you to pre-select responses that have a boolean (True or False, On or Off, 1 or 0) state, such as questions that involve radio buttons or check-boxes.

For your grid question, let's assume the name of your question is grid1 and we want to select the first row and first column (grid1_r1_c1). Here is how you would use this function. Place the following code into the footer of your grid1 question (we place this code in the footer because we want it to be executed after the entire question has been written to the screen).
<script type="text/javascript">
  SSI_SetSelect("grid1_r1_c1", true);

The code is almost identical for your select question. Let's assume the name of your question is select1 and you want to pre-select the first member (select1_1) of your predefined list. Here is what the code would look like:
<script type="text/javascript">
  SSI_SetSelect("select1_1", true);

If you have multiple check-boxes or radio buttons you want to pre-select in a question, you can copy and paste as many SSI_SetSelect lines as you need. Just keep an eye on those pesky semi-colons at the end of each line.
answered Sep 18, 2012 by Nathan Bryce Silver Sawtooth Software, Inc. (7,450 points)
selected Sep 18, 2012 by JKincaid
Is there any option to preselect only the check boxes chosen in the last question?