Have an idea?

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

Setting Input Box Width - Ranking Question

I can set the input box width in a constant sum question under the advanced / constant sum settings.

I noticed a ranking question does not supply the same option?

I assume some CSS script is required?

Looking forward to a helpful response.

Thank you.
asked Aug 3, 2016 by Paul Moon Platinum (98,670 points)

1 Answer

0 votes
Yes Paul, a little CSS should do you.  Try this (assuming the question is named Q5).

<style type="text/css">
    #Q5_1 {width: 75px;}
</style>
answered Aug 3, 2016 by Jay Rutherford Platinum (50,145 points)
Thanks Jay. This works.

One further question ...

If I have many codes to rank (say 10-20), do you have a suitable solution instead of defining all variables individually?

Thanks.
I know this works also ...

<style type="text/css">
     #Q5_1, #Q5_2, #Q5_3 {width: 75px;}
 </style>
I don't know of a way to apply the setting to all fields at once unfortunately.  Would probably require some javascript for that.
OK, thanks anyway. You have got me off to a good start.
The jQuery function "css" is great for mass editing the CSS.

<script>
$(document).ready(function(){
    for (var i = 1; i <= 10; i++) {
        $('#RankingQ_' + i).css('width', '75px');
    }
})
</script>
Thanks Zachary. Works a treat.
...