Have an idea?

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

Change format of Constant Sum Question

Hi there,

Do you have any idea how to switch Input boxes and labels (i.e. first read categories, then enter a number)? I hope there is some kind of workaround, given the default isn't really intuitive from my perspective.

Many thanks in advance.

Best,
asked Sep 17 by o4034695 (200 points)

2 Answers

0 votes
Check this forum post out ...

https://legacy.sawtoothsoftware.com/forum/24816/moving-the-input-cell-to-the-right-in-a-constant-sum-question?show=24816#q24816

I believe this script inserted in to the footer of your constant sum question should make the necessary adjustment.
<script>
$(document).ready(function(){
$('#[% QuestionName() %]_div .input_cell').each(function(){
    $(this).parent().append($(this));
});

$(window).resize(function(){
        var maxWidth = 0;
        $('#[% QuestionName() %]_div .option_cell').each(function(){
            var thisWidth = $(this).width();
            if (thisWidth > maxWidth) {
                maxWidth = thisWidth;
            }
        });
        $('#[% QuestionName() %]_div .option_cell').width(maxWidth);
    });
      
    $(window).resize();
})
</script>
answered Sep 17 by Paul Moon Platinum (85,380 points)
0 votes
While it would be nice, there isn't a default feature to do this on a constant sum question.  What I typically do is set it up as  a grid instead with the direction being column based.  Then you can set that column to a constant sum format.  This is a great alternative and gives you a bit more power on formatting options.
answered Sep 17 by Jay Rutherford Gold (38,005 points)
I do like Jay's alternative solution too. The grid formatting enables you to fiddle with the formatting.

Nice to have multiple options.
...