Welcome to the LimeSurvey Community Forum

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

sub lables or sub titles to split options in a multiple choice question

  • dennyseduardo
  • dennyseduardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago - 3 years 11 months ago #211495 by dennyseduardo
Dear all, 
How to do something like that?

I'm looking for a solution, somebody could help me, plz.
I'd like to build up a multiple choice question with a kind of division or categories, splitting some options in a multiple-choice question. How to create these sub titles like the image below?



 
Last edit: 3 years 11 months ago by dennyseduardo.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #211497 by Joffm
To insert some headers you remove the checkboxes and style it to your wishes.
 
Insert this into the question code (source code mode).
You see here "in eq(x)" that the 1st, 5th and 8th checkbox is removed (index starts at "0")
Code:
<script charset="utf-8" type="text/javascript">
    $(document).ready(function() {
        $( '#question{QID} .question-item:eq(0)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
        $( '#question{QID} .question-item:eq(4)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
        $( '#question{QID} .question-item:eq(7)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
    });
</script>
Code:
<style type="text/css">.hide-pseudo-elements label::before,
.hide-pseudo-elements label::after {
    display: none;
}
 
.hide-pseudo-elements .label-text {
    margin-left: -20px;
}
</style>

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #211498 by tpartner
Why not exactly as depicted? Several separate questions.

Regarding the side-by-side layout - you should consider how that will work on smaller devices like tablets or phones.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • dennyseduardo
  • dennyseduardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #211518 by dennyseduardo
Hi Joffm, 
Thanks a lot, but isn't working with me... look

Nothing happens. I added the code you gave me in the source mode before the question, and I indicated the variable 03 to have the checkbox hidden. But didn't work. 
Some idea?
The topic has been locked.
  • dennyseduardo
  • dennyseduardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #211519 by dennyseduardo
Yes tpartner,
don't need to be exactly as depicted.
I just would like to put some labels splitting the alternatives like that idea in the first image.

Do you have some idea?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #211521 by Joffm
Didn't you insert the css?

And your code removes the checkbox from SQ04,
As I said the first has index "0".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #211538 by holch

Yes tpartner,
don't need to be exactly as depicted.
I just would like to put some labels splitting the alternatives like that idea in the first image.

Do you have some idea?


He already told you his idea: use several separate questions, because this is basically what your image shows.

Why not exactly as depicted? Several separate questions.


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.
  • dennyseduardo
  • dennyseduardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #211549 by dennyseduardo
Yes.. It's worked now!!!
Perfect!

Thank you very much!
The topic has been locked.
  • dennyseduardo
  • dennyseduardo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #211550 by dennyseduardo
Yes, indeed! ;-)
I'm doing as you said. Thanks a lot! ;-)
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose