Have an idea?

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

Maxdiff - switch best to worst

Hi

I am scripting a MaxDiff and the client is asking that if a respondent chooses an option as "Best" and then selects it as "Worst" the option moves from Best to Worst, rather than being able to select both and then given an error message when clicking for the next screen. How would I go about this?

Thanks
Sarah
asked Jun 14, 2016 by anonymous

1 Answer

0 votes
Hi Sarah,

Please try putting this code in your MaxDiff exercise's footer.

<script type="text/javascript">
function SSI_CustomGraphicalRadiobox(graphicalRadiobox, input) {
    var id = input.id;
    var otherId;
    if (id.includes('_b_')) {
        otherId = id.replace('_b_', '_w_');
    }
    else {
        otherId = id.replace('_w_', '_b_');
    }
    SSI_SetSelect(otherId, false);
}
</script>


Does this meet your needs?
answered Jun 14, 2016 by Zachary Platinum Sawtooth Software, Inc. (105,875 points)
This is great, worked exactly as needed - thank you!
...