Have an idea?

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

I want to give alternate colouring to single select respondes

Hi all,

I want to colour the response options into alternate colouring for a single select question but couldnt find any way to do so.

I can only colour the grid questions.

Is there a way to do that ?
asked Jun 29 by Hitesh_Kalwani Bronze (540 points)

1 Answer

+1 vote
 
Best answer
Placing this script in your select question should add alternating colors to a select question:

<script>
$(document).ready(function(){
    var responseRows = $('#[% QuestionName() %]_div .response_row');
    for (var i = 0; i < responseRows.length; i++) {
        if (i % 2) {
            $(responseRows).eq(i).css('background-color', 'blue');
        }
        else {
            $(responseRows).eq(i).css('background-color', 'green');
        }
    }
})
</script>


The "blue" and "green" can be replaced with any CSS colors.
answered Jun 29 by Zachary Platinum Sawtooth Software, Inc. (91,500 points)
selected Jul 13 by Hitesh_Kalwani
Thanks a lot.. this worked :)
...