Have an idea?

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

Scripting Question for Volumetric (Allocation) CBC - possible to implement drop down for allocation text box?

I have a question regarding formatting the input box for Constant Sum/Allocation CBC. Currently, if you select Constant Sum/Allocation in the Format tab, it gives the respondent an input box. The range of answers respondents can enter are customizable in the Settings to include a range & total. Is there a script to convert/format the input text box to become a drop down with a set range of items (with default being 0)?

I imagine changing this input box to a drop down affect data and results given the limits/ restrictions the drop down would have. Is the ample concern here to caution against using a drop down?

asked Aug 8, 2017 by Marco Z (200 points)

1 Answer

0 votes
Put this code in your CBC's footer:

.cbc .numeric_input {
    display: none;

    var options = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50];
    var dropdownHtml = '<select class="cbcDropdown">';
        dropdownHtml += '<option value="' + option + '">' + option + '</option>';
    dropdownHtml += '</select>';
    $('.cbc .numeric_input').each(function(){

Line 9 should be updated with the options you want in the dropdowns.
answered Aug 8, 2017 by Zachary Platinum Sawtooth Software, Inc. (206,100 points)