Welcome to the LimeSurvey Community Forum

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

"Multiple options" question with several primary and secundary options

More
8 years 2 weeks ago #148699 by Babba
Hi everybody,
I am trying to use the workaround for "Multiple options" question with several primary and secundary options:

However I dont really understand what I have to do in this step:
"Call the function in the source of the question with the question ID (no editing necessary), the start position of the primary sub-question and the number of secondaries to follow. So, in this example, sub-question 1 is a primary followed by 2 secondaries and subquestion 6 is a primary followed by 3 secondaries.

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Sub-question 1 is primary followed by 2 secondaries
secondaryCheckboxes({QID}, 1, 2);
// Sub-question 6 is primary followed by 3 secondaries
secondaryCheckboxes({QID}, 6, 3);
});
</script>

Where excatly do I need to paste this code? And how do I indicated which question in my survey actually is the one with secondary options?

Help is very much appiciated
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 weeks ago #148700 by holch
Usually you need to put this into your question text. From there the {QID} part will be substituted automatically by the actual question id.

However, I am not sure if this works if there is more than one question on the same page. You'll need to test that yourself.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
8 years 2 weeks ago #148705 by Babba
I tried that, but it doesnt work, so I tought I misunderstood. But apparently not.
Is there anything else I need to take care of for it to function?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 weeks ago #148706 by holch
Can you post a link to where you have the script from and a .lss file?

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
8 years 2 weeks ago #148710 by Babba
This is where I got the script www.limesurvey.org/manual/Workarounds:_M..._options.22_question

And this is the Java template I used. At the very end there is the part for the secondary checkbox:
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose