Have an idea?

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

How to reset CBC choice response?

Hi :
In one of my study, I need set an event to reset the choice in current CBC page.
I am trying to use the SSI_RadioReset() function but failed. It seems this function doesn't match the new lighthouse studio's CBC response button style.

Is there anyone who can share some ideas on how to do this?

asked Jul 26, 2019 by fisherliu (260 points)

1 Answer

0 votes
Best answer
You're off to a good start.  SSI_RadioReset will still clear out the radio buttons behind the scenes for us, so all that's left to do is remove some CSS classes so the question doesn't look answered.  Here's a JavaScript function that should wrap all the behaviors we're after:

function SSI_ResetCbc(cbcTask) {
    SSI_RadioReset(cbcTask + '_b');
    SSI_RadioReset(cbcTask + '_w');
    $('#' + cbcTask + '_div .cbc_concept.best, #' + cbcTask + '_div .nav_dot.best').removeClass('best');
    $('#' + cbcTask + '_div .cbc_concept.worst, #' + cbcTask + '_div .nav_dot.worst').removeClass('worst');

You should pass into it the same parameter you'd pass into SSI_RadioReset.
answered Jul 26, 2019 by Zachary Platinum Sawtooth Software, Inc. (148,450 points)
selected Jul 30, 2019 by fisherliu
Hi Zachary´╝Ü
Awesome answer!.
 Your code works perfectly in my program.