Welcome to the LimeSurvey Community Forum

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

Inserting conditional free text box between arrays of questions

  • rehanfarrukh
  • rehanfarrukh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago - 2 years 6 months ago #226765 by rehanfarrukh
 

File Attachment:

File Name: limesurvey...2723.lss
File Size:52 KB
Please help us help you and fill where relevant:
Your LimeSurvey version: [5.3.6] and Version 5.3.4+220309
Own server or LimeSurvey hosting: Both
Survey theme/template:
==================

I am trying to add a condition free text box between arrays (sub-questions). For example, if participant selects Disagree or Strongly Disagree, then an open text field box shows up right next to sub question..
I have designed the following survey. I would like question 5a and 6a appear right below their relevant array question 5 and 6 respectively if they select "disagree" or "strongly disagree", not outside the array just like I currently did. Is there a way to do that? Sorry I am totally new to LimeSurvey and have no knowledge of coding.

[update] Iss file is also attached.

Thanks so much for your help!

Regards,
Rehan 
Last edit: 2 years 6 months ago by rehanfarrukh.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #226769 by tpartner
Without a survey export (.lss file), we have no way of answering that.

I suggest you start with the manual section on relevance - manual.limesurvey.org/ExpressionScript_-..._Cascading_Relevance .

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.

  • rehanfarrukh
  • rehanfarrukh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #226770 by rehanfarrukh
Thanks. I added .Iss file in my post.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #226778 by Joffm
Hi, 
though I am pretty sure that Tony will show his (awesome) javascript solution, here is mine without javascript.
Only put the two css classes "no-question" and "no-bottom" into your "custom.css"

I splitted the question into three parts and ordered like this
Q2a_SQ001-Q2a_SQ005  with css class "no-bottom"
free text for SQ005  with css classes "no-question no-bottom"
Q2b_SQ006  with css classes "no-question no-header no-bottom"
free text for SQ006  with css classes "no-question no-bottom"
Q2b_SQ007  with css class "no-question no-header"

Here these two classes and an additional "no-header" to get  rid of the repeating headers.
Code:
.no-question { border-top:0; }
.no-question .question-title-container { display:none; }
.no-question .question-valid-container { display:none; }
.no-bottom{border-bottom:0;margin-bottom:0;}
.no-question .answer-container {
    padding-top: 0em;
    padding-bottom: 0.5em;
}
.no-header tr.ls-heading { display:none; }
.no-bottom .answer-container {
    padding-bottom: 0em;
}

To get rid of the repeated header I used the style
And a conditional text in the subquestions




 

File Attachment:

File Name: limesurvey... (1).lss
File Size:66 KB


Joffm

​​​​​​​By the way: This feature (merging questions) is included in DenisChenu's theme "skelvanilla"

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: rehanfarrukh

Please Log in to join the conversation.

  • rehanfarrukh
  • rehanfarrukh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #226782 by rehanfarrukh
Thanks a heap, Joffm!
Sorry, are you able to confirm where do I add the above code to get rid of repeated headers? Can you attach the screenshot? That would be so helpful.
Thanks,
Rae

Please Log in to join the conversation.

  • rehanfarrukh
  • rehanfarrukh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #226785 by rehanfarrukh
When I imported your .lcc file it is displaying headers for 5a, 6 and 6a. Like they are not together just like in your 2nd screenshot above. Do I need to add/update something?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #226796 by Joffm
Did you add the css script to your "custom.css"?

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

Please Log in to join the conversation.

  • rehanfarrukh
  • rehanfarrukh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #226797 by rehanfarrukh
sorry, i have no idea how to add custom.css. Where do I find "custom.css"? I am totally new to LimeSurvey so have no clue.

Do I need to create or import .css file? Then how? Or is it built-into LimeSurvey? Will it just be one .css file for the whole survey or every question will or can have it's own .css file?

I am still learning LS as I go and this was my first survey that i created.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #226798 by Joffm
 
Extend your theme
 

Read the manual
[url] manual.limesurvey.org/New_Template_System_in_LS3.x/en [/url]

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: rehanfarrukh

Please Log in to join the conversation.

  • rehanfarrukh
  • rehanfarrukh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #226801 by rehanfarrukh
Thank you Joffm. Will do! Much appreciate your time and dedication!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose