Welcome to the LimeSurvey Community Forum

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

Other-Option with free-text within Matrix

More
2 years 10 months ago - 2 years 10 months ago #233507 by spiritgolem
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.17.3+190429
Own server : yes
Survey theme/template: standard
==================

I am looking for an Option / Workaround to implement a "other:[free-text]" option within a matrix question.

I usually do it by adding an additional free-text question that filters on given answers for the "Other" option given within the matrix, but this is not sufficient for my design.
Example on how I usually do it: 

Is there a way how I can give the possibility to input text within the sub-questions text, so that respondents have a free-text field after/within "Other:", where they can input text (e.g. Other: "fruit gum") and than rate it within the matrix?


Sorry if this has already been answered somewhere else as I could not find answers. In that case please link me to that thread!
Last edit: 2 years 10 months ago by spiritgolem.

Please Log in to join the conversation.

More
2 years 10 months ago #233518 by tpartner
This script in the source of the array will hide the following short-text question and move the input into the last array column label cell:
 
 
Code:
<script type="text/javascript" data-author="Tony Partner">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify the questions
    var thisQuestion = $('#question{QID}');
    var nextQuestion = thisQuestion.nextAll('.text-short:eq(0)');
 
    // Hide the next question
    $(nextQuestion).hide();
 
    // Move the text input
    $('tbody th.answertext:last', thisQuestion).addClass('text-item').append($(':text.form-control', nextQuestion));
 
    });
</script>

Sample survey attached:  

File Attachment:

File Name: limesurvey...3293.lss
File Size:21.47 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: spiritgolem

Please Log in to join the conversation.

More
2 years 10 months ago #233545 by spiritgolem
Thank you that helps a lot! :)

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose