Welcome to the LimeSurvey Community Forum

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

How to add more than one others And How to add for particular code

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #225886 by Joffm
Hi,
I wonder why you didn't answer the initial questions?

But as an answer:
You can't add more than one "Other" in a multiple question.
You have to use a question of type "Multiple choice with comments" and remove the not desired "Other"-fields.
Insert this in the source code of  your question
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() { 
        var thisQuestion = $('#question{QID}');
        // Remove some text inputs
        $('.checkbox-text-item:eq(x) .comment-item', thisQuestion).remove();
        $('.checkbox-text-item:eq(y) .comment-item', thisQuestion).remove();
    });
</script>

Replace "eq(x), eq(y)" by the respective subquestions indexes where you want to remove the text box.
The counting starts at 0.

 
Joffm

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

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #226034 by tpartner
Asking the question several times will not get a faster answer. Please remember that we are volunteers and have jobs and lives.

Depending on your sub-question codes, something like this in the question validation equation:

Code:
count(self.sq_SQ001) == 0 OR count(self.sq_SQ001) == 2
AND
count(self.sq_SQ002) == 0 OR count(self.sq_SQ002) == 2
AND
count(self.sq_SQ003) == 0 OR count(self.sq_SQ003) == 2

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 month ago #226042 by Joffm
Hi,
tpartner showed you he validation equation already.
Read the manual here about the function "count()"
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]
and here about the variable "self"
[url] www.limesurvey.org/manual/ExpressionScri....22that.22_variables [/url]
and you understand the meaning
"Either there is no mention in one subquestion (count==0) or there are two (count==2). So it is not possibly only to check the box without comment"

Joffm

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose