Have an idea?

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

Preselect a combo box to the first choice

Does anyone have a way with javascript to preselect the first choice of a combo box when the question loads?  I have a list with labels 0-15 and tried using the SSI_SetSelect in javascript but that doesn't seem to work with a combo box.  My client would like it to default to the first choice.

This is what I tried:
<script type="text/javascript">

  SSI_SetSelect("Q13A_r1_c1_1", true);
  SSI_SetSelect("Q13A_r2_c1_1", true);
  SSI_SetSelect("Q13A_r3_c1_1", true);
  SSI_SetSelect("Q13A_r4_c1_1", true);
asked Aug 20, 2015 by Jay Rutherford Gold (31,520 points)
Jay, I am not convinced that SSI_SetSelect works with combo boxes? I would confirm with Sawtooth support.
Thanks Paul, I believe that was what I found to be true, so was hoping for another solution.  I believe I just had them accept it without the default to the first choice for that study.

1 Answer

0 votes
Firstly, have you pasted the script into the question footer - it only works in the question footer I believe...
answered Nov 16, 2015 by rapizel Bronze (1,420 points)
I did have that code in the footer.  This was a while back, but I believe I found what Paul said to be true, the SSI_SetSelect did not work with a combo box so I was looking for another solution.