Welcome to the LimeSurvey Community Forum

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

Array with 3 Cols: 2 normal Cols and 1 Col (text)

  • borste
  • borste's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #143742 by borste
Hi Experts,
for my survey I need a combination of two cols of normal array (or list-elements) and one col of text (as a commentary).
Can somebody help me?
Thank you.
borste
LimeSurvey
Version 2.52+160920
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143743 by tpartner
You will need to insert a hidden multiple-short-text after the array and use JavaScript to move the text inputs up into the array. Here's a couple of posts for inspiration (searching the forum may lead to more):

- www.limesurvey.org/forum/design-issues/9...to-text-input#102550
- www.limesurvey.org/forum/can-i-do-this-w...-and-dropdown#120555

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: borste
The topic has been locked.
  • borste
  • borste's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #143842 by borste
Hallo,

thanks for your suggestions.
As far as I understood I have to insert the scripts into the definition of the each question, is that right?
Or is there a way to insert the scripts in the templates?

Thanks
borste
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago - 7 years 5 months ago #143845 by Joffm
Hi, borste,
of course you can insert scripts into the template.
It's always the same procedure:
css you insert into the template.css
js you insert into the template.js

But sometimes it is mandatory to place the script into the specific question.
The only general answer is: you are able to insert it into the template.
When it is advisable depends on the circumstances.

And a different approach is:
create your own js script and in the startpage.pstpl call it after {TEMPLATEJS}
like:
Code:
{TEMPLATEJS}
<script type="text/javascript" src="{TEMPLATEURL}/my_script_folder/my_script.js"></script>

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 5 months ago by Joffm. Reason: Typo
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143849 by tpartner
Note that targeting specific questions is more difficult from template.js or the .pstpl files - the {QID} placeholder does not work.

My approach, for ease of editing, is to place larger functions in template.js and call them from within the question source.

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