Welcome to the LimeSurvey Community Forum

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

Array - adding headings/labels (not repeating)

  • jyu183
  • jyu183's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #226686 by jyu183
Please help us help you and fill where relevant:
Your LimeSurvey version: [3.27.26]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi everyone, 

I would like to ask a question about adding headings to the Array (and Array Numbers). Please first find attached the two screenshots - the underlined bits are headings (labels), and these screenshots are how I want the survey look like. 

These headings may be a repeating header but they are not repeating regularly (ie not appearing after every certain number). For instance, as in the first screenshot, the heading appears in line 1, and then appears again in line 8. I have attached .lss file for this. 

If possible, I would also like to be able to change the font colour and size of the headings; to distinguish them more clearly from other options. 

Could you please help with this? It would be really appreciated!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226687 by Joffm
Hi, quick Sunday night answer:
earch the forum for keyword "subheading1" and you will find a huge amount of examples.

Joffm

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

Please Log in to join the conversation.

  • jyu183
  • jyu183's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago - 3 years 2 months ago #226688 by jyu183
Thank you Joffm; I've found and tried your script from here: forums.limesurvey.org/forum/design-issue...ubheaders-and-labels

This script seems to be working only for Array type, though, and not for Array (Numbers) - checkbox type. As I was trying to use Array (Numbers) checkbox, no subheading is displayed. And I couldn't find the code for Array Numbers checkbox unfortunately. 

When you have time, could you advise how the script can work for Array (Numbers) - checkbox? This may be a silly question (as I am code novice), but I would really appreciate your advice on this.
Last edit: 3 years 2 months ago by jyu183.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago - 3 years 2 months ago #226700 by Joffm
Hi,
As you saw, this 4-years old script was for version 2.65. Do you have a wrong setting to search, that you find the oldest post first?

Furthermore you see in this script the  lines
$('tr.answers-list:eq(0)',...

You know, a question of type "array(numbers)" doesn't have "answers", but "subquestions"
Therefore your first try could have been to exchange these to
$('tr.subquestion-list:eq(0)',...

And here you find a newone for version 3.x.
[url] forums.limesurvey.org/forum/german-forum...nlich-doppelt#207884 [/url]

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 2 months ago by Joffm.
The following user(s) said Thank You: jyu183

Please Log in to join the conversation.

  • jyu183
  • jyu183's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #226752 by jyu183
Many thanks Joffm; this is super helpful, the code is working greatly!

Just one small last question; when I added style css to the code to change the font/colour of heading, it displays a small question mark icon on the top left, as you can see in the attached screenshot. I wonder what this is about and whether I could remove this? This doesn't appear when not using <style>. 
Attachments:

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226754 by Joffm
As you said

I added style css to the code

and

This doesn't appear when not using <style>

It is a change you made.
So, how can we answer this question without seeing what you did.

Always: lss export of the relevant questions.

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 2 months ago #226758 by tpartner
Replied by tpartner on topic Array - adding headings/labels (not repeating)
If you add the <style> element to the question help section, the help icon will be displayed.

Add the <style> element (and JavaScript) to the question text source.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jyu183

Please Log in to join the conversation.

  • jyu183
  • jyu183's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #226763 by jyu183
Thanks Joffm; what I meant was what tpartner mentioned, so now it's fully solved!

Please Log in to join the conversation.

  • jyu183
  • jyu183's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #226764 by jyu183
Thanks so much tpartner; now fully solved!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose