- Posts: 7
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
I'm not sure why you would want to hide/show rows in an array-by-column question. Shouldn't the answers always be shown?Hi tpartner,
Thanks again for your solutions. I came across this topic, which helped me a lot. Is there a way to modify your code so that we have a button to add more "other" lines ? Or add a "other" line if the previous one is completed ?
I am using LS community edition 5.4.x
Thank you in advance !
Best regards,
David
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify the questions var thisQuestion = $('#question{QID}'); var nextQuestion1 = $(thisQuestion).nextAll('.text-short:eq(0)'); var nextQuestion2 = $(thisQuestion).nextAll('.text-short:eq(1)'); var nextQuestion3 = $(thisQuestion).nextAll('.text-short:eq(2)'); var nextQuestion4 = $(thisQuestion).nextAll('.text-short:eq(3)'); var nextQuestions = $(nextQuestion1).add(nextQuestion2).add(nextQuestion3).add(nextQuestion4); var nextLength = nextQuestions.length; var sqLength = ('tr.answers-list', thisQuestion).length; // Hide the short-text questions $(nextQuestions).hide(); // Move the hidden text inputs into the array for (i = 0; i < nextLength; i++) { var workingIndex = (sqLength - 1) - (nextLength - i); var nextQ = nextQuestions[i]; $('th.answertext:eq('+workingIndex+')', thisQuestion).append($('input[type="text"]', nextQ)).closest('tr').addClass('otherRow'); } // Clean-up styling $('th.answertext .answer-item', thisQuestion).css({ 'padding': 0 }); $('th.answertext .answer-item div', thisQuestion).css({ 'padding': 0 }); }); </script>
Please Log in to join the conversation.
Fine, adapt the subquestion relevance.Checking a box in 1st or 2nd column is not necessary.
As the loop is part of the script it works or it does not.and it works fine until the loop
If you compare the two scripts you will seeis it necessary to implement the loop
As you see in the subquestion relevance I used the variable "self"I am not sure I understood your point concerning the coding of the axis
Please Log in to join the conversation.
Please Log in to join the conversation.
I thought there was a loop that made the number of "other" options infinite.
Please Log in to join the conversation.
Please Log in to join the conversation.