Welcome to the LimeSurvey Community Forum

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

Headline in multiple Choice

  • cgebauer
  • cgebauer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #143538 by cgebauer
Headline in multiple Choice was created by cgebauer
Hello again,

I have one more question:
I want to create topics for the choices (see screenshot)
For topic 2 I just extended the last answer of topic 1. But that doesn't work for the first one because there is no upfront.
A solution without a java script would be perfect.

I very much appreciate your help.
Thank you!
Attachments:
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #143541 by Joffm
Replied by Joffm on topic Headline in multiple Choice
Hi, quaxp,
maybe this helps.
www.limesurvey.org/community-services/fo...iple-choice-question

Regarding your dislike of JS.
For years browsers have JS "on" per default; and it's not so easy to switch it to "off".
So I should say: In times of bootstrap (or other) based websites nearly anybody uses JS.
The times that JS was condemned are long, long ago.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #143543 by tpartner
Replied by tpartner on topic Headline in multiple Choice
You could hide those check-boxes with pure CSS but respondents would still be able to toggle them if navigating threw the form with the tab key and space bar.

Also not that without JS, your respondents will be presented with a warning at the top of the page, the progress bar will not work and dynamic on-page Expression Manager will not work.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • cgebauer
  • cgebauer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago - 7 years 4 months ago #143576 by cgebauer
Replied by cgebauer on topic Headline in multiple Choice
Thank you! I think I will just try it with JS. Will there be issues if the participant has JS deactivated?

Somehow, the script does not work when I implement it (I am using Version 2.54.2+161012)

Could you have a look into the question?
I uploaded it.

Many thanks!
Last edit: 7 years 4 months ago by cgebauer. Reason: whole survey instead of one question
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #143587 by tpartner
Replied by tpartner on topic Headline in multiple Choice
You have some syntax errors in your script and are targeting the wrong element. Additionally, you will need to hide the pseudo-elements (fake checkboxes) inserted by LimeSurvey.

I would add something like this to the question source:
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();
  });
</script>

And, add something like this to the end of template.css:
Code:
.hide-pseudo-elements label::before,
.hide-pseudo-elements label::after {
  display: none;
}
 
.hide-pseudo-elements .label-text {
  margin-left: -20px;
}

I would do the same thing for your second "headline" (see my attached version of your survey). As you have that now, simply adding text in the label for "C", if you click on that "headline", the "C" checkbox will be toggled.

Survey attached:

File Attachment:

File Name: limesurvey...1179.lss
File Size:17 KB



Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose