Have an idea?

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

Pre selecting check box if previous condition match

I need to preselect the check box if the condition matched with the previous answer. For example if :

M1_r9_c1=1 then MTFS1_r9_c1 should be preselected.

I don't much understand Java Script but from this forum I came to know we can do it using Java for example to preselect  a radio button we can use the given below script:

<script type="text/javascript">
  SSI_SetSelect("grid1_r1_c1", true);
</script>

However, in my case I have to implement it based on previous answer and on check box rather than radio button.

Please help.
asked Oct 28, 2014 by Rashid (230 points)

1 Answer

0 votes
You can use the SSI_SetSelect function which will tick the check box and update the data file accordingly.

In the 2 examples below, the Q2 code 10 check box will be ticked as you submit Q2 and the data will become a "1" for the  Q2_10 variable.

Example 1 (sample field condition)
if ("[%Firm%]"=="Acme")
{
 SSI_SetSelect("Q2_10", true);
}

Example 2 (survey question condition)
if ("[%Q1%]"=="1")
{
 SSI_SetSelect("Q2_10", true);
}

Pop your script into the custom JavaScript verification tab window which is found by clicking on the advanced button of your question (in this example Q2).
answered Oct 28, 2014 by Paul Moon Platinum (55,825 points)
...