Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Multiple 'other' options with comments, where radio list has no comments

  • kathrynedworthy
  • kathrynedworthy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 6 months ago #232726 by kathrynedworthy
Please help us help you and fill where relevant:
Your LimeSurvey version:  Version 3.28.31
Own server or LimeSurvey hosting:
Survey theme/template: Vanilla
==================
Hi there,

I'm trying to get a radio question with three 'option with comments' boxes, but where all the other list options have no comment boxes.

Is this possible?



Many thanks in advance,
Kathryn

 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232732 by Joffm
Hi,
sorry, what do you want to achieve?

A radio list with multiple "others"?
Why? If you can only select one option?

Or do you talk about a multiple question?
You can use a question of type "multiple with comments" and remove the comment boxes from the "normal" items.

 
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(1) .comment-item', thisQuestion).remove();
        $('.checkbox-text-item:eq(2) .comment-item', thisQuestion).remove();
        $('.checkbox-text-item:eq(3) .comment-item', thisQuestion).remove();
    });
</script>

Or would you like to have only one of the fixed options but one or more "Others"?
This you may do by validation.

So, please, explain.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 6 months ago #233048 by carlalmeida_2022
Hello,

I would like to do one question of type "multiple with comments" and remove the comment boxes from the "normal" items, just as you explain. However, I cannot understand where can I edit the script to copy what you have done. Could you help me please?

Thank you in advance for your help!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #233087 by Joffm
Hi,
I do not quite understand.
You see the script in this thread,
Put it into your question text (in source code mode).
Now you adapt to your needs.
You see the ":eq(0)", ":eq(1)",...
Here you define in which subquestions the text box is removed, starting with 0 for the first subquestion.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose