Welcome to the LimeSurvey Community Forum

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

Comment box prior to subquestion

  • mt9999
  • mt9999's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #225922 by mt9999
Comment box prior to subquestion was created by mt9999
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.2.13
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template: fruity
==================
Hi everyone, 
I'm having trouble finding a similar thread for this question. Is there a code I can use to make it so that the comment box appears before the subquestion in a multiple short text question? 

Similarly, I've made a list-radio question and replaced the Other comment box with one of my subquestions. I'd like to make the comment box appear before my answer. I'd also like to make this the first option in the list of subquestions. Is this possible?

Thank you all, I'm attaching the lss and image.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225923 by tpartner
Replied by tpartner on topic Comment box prior to subquestion
First question - leave the sub-question text empty and use the "Suffix" option - www.limesurvey.org/manual/Question_type_...#Suffix_.28suffix.29

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.

  • mt9999
  • mt9999's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #225924 by mt9999
Replied by mt9999 on topic Comment box prior to subquestion
Thank you for your fast response! I was able to figure out my first question with the suffix option!

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225925 by tpartner
Replied by tpartner on topic Comment box prior to subquestion
Second question - this script will move the "Other" row to the top and place its label after the text input:

Code:
<script type="text/javascript" data-author="Tony Partner">  
  $(document).on('ready pjax:scriptcomplete',function(){
 
    var thisQuestion = $('#question{QID}');
    var answersList = $('.ls-answers.answers-list > ul:eq(0)', thisQuestion)
 
    // Move the last row
    $(answersList).prepend($('li:last', answersList));
 
    // Move the label
    $('li:first', answersList).append($('li:first .radio-item', answersList));
 
    // Hide the radio
    $('li:first .radio-item', answersList).removeClass('radio-item');
    $('li:first input:radio', answersList).css({
      'position': 'absolute',
      'left': '-9999em'
    });
 
  });
</script>

 

Sample survey attached: 

File Attachment:

File Name: limesurvey...5846.lss
File Size:24 KB

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.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225931 by Joffm
Replied by Joffm on topic Comment box prior to subquestion
Sorry, one question

What are you going to achieve?

The array solution you asked for in the other thread?
Or now a single question solution?

Joffm


 

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

Please Log in to join the conversation.

  • mt9999
  • mt9999's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #225932 by mt9999
Replied by mt9999 on topic Comment box prior to subquestion
Thank you a ton! This worked well for me. I'm trying to figure out how to adjust the size of the "other" text box. I've used the below code to apply to an extend fruity theme but it seems nothing is changing. Perhaps I'm missing something obvious?

.list-radio input.text {
width: 600px;
}

Thanks again!

Please Log in to join the conversation.

  • mt9999
  • mt9999's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #225933 by mt9999
Replied by mt9999 on topic Comment box prior to subquestion
Hi Joffm, thank you for the question.
This would be for a single question solution.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225954 by tpartner
Replied by tpartner on topic Comment box prior to subquestion
If you only want to affect the input width for this question, you can place something like this in the source of the question text:

Code:
<style type="text/css" data-author="Tony Partner">
  @media (min-width:768px){
    #question{QID} .other-text-item input {
      width: 600px;
    }
  }
</style>

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: mt9999

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose