Have an idea?

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

Hide checkbox in SSI Web 8

How can I hide a checkbox in a multiple response grid question in SSI Web 8. All the proposed questions on this support site do not work. Can someone provide me with a sample link with dummy values? That would be awesome.

Thank you in advance,
Nabil
asked Jul 4 by Nabil Djemai

1 Answer

+1 vote
Putting this code in your survey's HTML head tag adds easy-to-use JavaScript functions for enabling and disabling graphical radio buttons and checkboxes:

<style>
.clickable {
    position: relative;
}

.disabledGraphicalOverlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    cursor: default;
}
</style>

<script>
function SSI_DisableGraphicalInput(id) {
    $('#' + id).closest('.clickable').append('<div class="disabledGraphicalOverlay"></div>');
    $('.disabledGraphicalOverlay').click(function(event){
        event.stopPropagation();
    });
    $('#' + id).closest('.clickable').find('.text_input, textarea').prop('disabled', true);
    $('#' + id).siblings('.graphical_select').css('opacity', 0.5);
}

function SSI_EnableGraphicalInput(id) {
    $('#' + id).closest('.clickable').find('.disabledGraphicalOverlay').remove();
    $('#' + id).closest('.clickable').find('.text_input, textarea').prop('disabled', false);
    $('#' + id).siblings('.graphical_select').css('opacity', 1);
}
</script>


(You can replace the "0.5" with "0" on line 24 to turn disabled checkboxes entirely invisible.)

Then in the grid question, you can disable certain inputs like this:

<script>
$(document).ready(function(){
    SSI_DisableGraphicalInput('GridQ_r1_c2');
    SSI_DisableGraphicalInput('GridQ_r3_c1');
})
</script>


Is that helpful for you?
answered Jul 4 by Zachary Platinum Sawtooth Software, Inc. (63,900 points)
Awesome!! Thank you Zachary, it works.
...