- Posts: 74
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Hiding specific checkboxes in multiple choice & with comments
- asilbering
- Offline
- Senior Member
Less
More
4 years 3 months ago #192745
by asilbering
Replied by asilbering on topic Hiding specific checkboxes in multiple choice & with comments
Hi tpartner,
I am trying to hide the text boxes for some subquestions in a multiple choice with comments question.
There are 7 "main" subquestions that should not have a comment box. These are kind of "category headings". If one of these is selected then "sub-items" are displayed, for which I would like to have a comment box, that should be mandatory if the box is checked.
A sample survey is attached.
I have tried the script you proposed with no success. (not even the last text box is hidden). Could you please give me a hint on how to proceed?
thanks in advance!
Ana
I am trying to hide the text boxes for some subquestions in a multiple choice with comments question.
There are 7 "main" subquestions that should not have a comment box. These are kind of "category headings". If one of these is selected then "sub-items" are displayed, for which I would like to have a comment box, that should be mandatory if the box is checked.
A sample survey is attached.
I have tried the script you proposed with no success. (not even the last text box is hidden). Could you please give me a hint on how to proceed?
thanks in advance!
Ana
Attachments:
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
4 years 3 months ago #192747
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Hiding specific checkboxes in multiple choice & with comments
Hi, Ana,
though you didn't address me, a short answer.
Your javascript to hide the comments should be:
You have to add the numbers of other coment-items.
You see
Joffm
though you didn't address me, a short answer.
Your javascript to hide the comments should be:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var thisQuestion = $('#question{QID}'); // Remove some text inputs $('.checkbox-text-item:eq(0) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(8) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(16) .comment-item', thisQuestion).remove(); }); </script>
You see
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- asilbering
- Offline
- Senior Member
Less
More
- Posts: 74
- Thank you received: 1
4 years 3 months ago #192749
by asilbering
Replied by asilbering on topic Hiding specific checkboxes in multiple choice & with comments
Thanks Joffm!!
That works great!
Best,
Ana
That works great!
Best,
Ana
The topic has been locked.