I'm doing a survey.But i don't know how to hide the checkbox before the category label. In order to display the category label, I insert them into the list label, now I want to hide the checkbox before the category label, I don't know how to do this,
See the details in the attachment!
Could you give me a favor?
Thanks in advance!!!
Shirley33 wrote: Thanks , I tried your method. But it seems that the checkbox is still visible.
Next time provide information about your LS version and other relevant things. For 2.5x you should probably do something like this to hide the checkbox instead.
I would like to do this in Limesurvey 3.14. I'm using a multiple choice with comments question type and would like to have the first two checkbox disabled and hidden, while the third answer has the comment box disabled and hidden. I've attached a picture of what I'm looking for. Please note that the third answer is exclusive.
The biggest issue I'm having is dissociating the checkbox to the answer label.
Any help will be appreciated! This is the code that I've put together.
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Identify this question
var thisQuestion = $('#question{QID}');
// Hide the first 2 checkboxs and 3rd comment box
$('#answer611171X1199X424181').attr('disabled','disabled'); //disable checkbox
$('label[for="#answer611171X1199X424181"]').hide(); //hide the checkbox
$('#answer611171X1199X424181').attr('disabled','disabled'); //disable checkbox
$('label[for="#answer611171X1199X424181"]').hide(); //hide the checkbox
$('#answer611171X1199X424181comment').attr('disabled','disabled'); //disable comment box
$('input[for="#answer611171X1199X424181comment"]').hide(); //hide the checkbox
});
</script>
In 3.x, the visible check-boxes are actually pseudo elements so you'll have to use a combination of CSS and JavaScript.
Add something like this to the question source:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');
// Add classes to the first two sub-question rows
$('.checkbox-text-item:lt(2)', thisQuestion).addClass('with-hidden-checkbox');
// Hide the 3rd text input
$('input:text:eq(2)', thisQuestion).hide();
});
</script>
Extend your theme and add something like this to the end of custom.css: