Welcome to the LimeSurvey Community Forum

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

Array (numbers) - Can I switch the subquestion text and input box around?

  • DB1324
  • DB1324's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago - 5 years 6 months ago #174541 by DB1324
Hi all,

I need to mimic the layout of a paper questionnaire as closely as possible. This includes a simple numbers array, which by default displays like this in LimeSurvey:


However, I need to try and display the input box first on the left, and the text to the right, as per the second image:


I don't want to amend the template because that would affect other questions, so it is possible to achieve this switch round any other way?

Thanks!

(We're on Version 2.65.1+170522)
Last edit: 5 years 6 months ago by DB1324.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174552 by tpartner
Can you attach a small sample survey (.lss file) containing only that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DB1324
  • DB1324's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174554 by DB1324
Hi Tony,

Yes, I've attached a sample.

Thanks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174560 by tpartner
Add this script to the source of the question:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Move the array cells
    $('#question{QID} col.answertext').before($('#question{QID} col.col-hidden:eq(0)'));
    $('#question{QID} tr.subquestion-list').each(function(i) {
      $('.answertext', this).before($('.answer-item:eq(0)', this));
    });
  });
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...2221.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 following user(s) said Thank You: DB1324
The topic has been locked.
  • DB1324
  • DB1324's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174562 by DB1324
That's perfect, thank you so much Tony. I really appreciate your help.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose