Have an idea?

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

ACBC BYO - pre-setting the combo box of an attribute to a given level

Hello all,

I'll spare you the background as to why, but I would like to pre-select some levels in some attributes in an ACBC BYO.

Pre-setting a combo box seems to work with a standard question: select question called DDtest, the code below will indeed pre-select option 2.

$("#DDtest").val('2');



But the following code to try and preset attribute 10 to level 2 of an ACBC BYO (exercise called ACBC) does not work (nothing happens on the combo box).

$("#ACBC_BYO_10").val('2');


Any clue / pointer?

Thanks,
amic
asked May 11, 2018 by amic Bronze (1,030 points)

1 Answer

+1 vote
Looks like the HTML for BYOs with dropdowns is a bit different than some other dropdown questions.  Try this:

$('select[name="ACBC_BYO_10"]').val(2);


"ACBC" being the name of your exercise, of course.
answered May 11, 2018 by Zachary Platinum Sawtooth Software, Inc. (124,400 points)
This works!

Zachary's magic once again, thanks a bunch.
-amic
...