Welcome to the LimeSurvey Community Forum

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

Multiple choice with two comments boxes

More
5 years 4 months ago #197442 by startx25
Hi all,


I want to use two comments (or three) boxes in multiple choicie question.
I have read all documentation and can't find some help.

how can i use multiple choice with comments question, but with two comments texte boxes

thank you for any help
The topic has been locked.
More
5 years 4 months ago - 5 years 4 months ago #197454 by Joffm
You might use a different question type, e.g.array(text).
You may insert a dropdown in the first column with "Yes/No" and two or more "normal" text inputs.



Joffm

Or do you want to hide the comment boxes except two or three?

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 years 4 months ago by Joffm.
The topic has been locked.
More
5 years 4 months ago #197459 by startx25
thanks for you response.

I don't want a drop list, juste multichoice with two comments.

Multichoice dont use an array (it use div tags)
The topic has been locked.
More
5 years 4 months ago #197465 by holch

Multichoice dont use an array (it use div tags)


If you insist on Multiple Choice, then it will be far more complicated, which is why Joffm has suggested a dropdown with "yes/no" which basically has the same effect as a multipe choice.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
5 years 4 months ago #197467 by Joffm
Though I do not see what is the difference for the respondent

of course, it's up to you.

Maybe someone here provides a different solution.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
5 years 4 months ago #197486 by startx25
Hi jhon,

thank you.

finaly i found a javascript that replace a text box to a checkbox in textarray question :


<script type="text/javascript" charset="utf-8">

$(document).ready(function(){

// Identify this question
var thisQuestion = $('#question{QID}');

// Assign column-specific classes
$('table.subquestion-list tr', thisQuestion).each(function(i) {

$('> *:gt(0)', this).each(function(i){
$(this).addClass('column-'+(i+1));
$(this).attr('data-column', i+1);
});
});

// Hide the text inputs in columns 1 and 4
$('.column-1 input[type="text"]', thisQuestion).hide();






// Insert the checkboxes into column 1
$('.answer-item.column-1').append('<input class="checkbox inserted-checkbox" type="checkbox" />');

// Initial checkbox states (if the question has already been answered)
$('.answer-item.column-1 input[type="text"]').each(function(i){
if($.trim($(this).val()) == 'Y') {
$(this).closest('td').find('.inserted-checkbox').attr('checked', true);
}
});

// Listener on the checkboxes (insert "Y" into hidden text input when checked)
$('.inserted-checkbox').change(function() {
if($(this).is(':checked')) {
$(this).closest('td').find('input[type="text"]').val('Y');
}
else {
$(this).closest('td').find('input[type="text"]').val('');
}
});
});
</script>

it's work gread, now just looking to center the checkbox
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose