Welcome to the LimeSurvey Community Forum

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

Multiple choice with two comments boxes

  • startx25
  • startx25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #197442 by startx25
Multiple choice with two comments boxes was created 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.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago - 3 years 11 months ago #197454 by Joffm
Replied by Joffm on topic Multiple choice with two comments boxes
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: 3 years 11 months ago by Joffm.
The topic has been locked.
  • startx25
  • startx25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #197459 by startx25
Replied by startx25 on topic Multiple choice with two comments boxes
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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197465 by holch
Replied by holch on topic Multiple choice with two comments boxes

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.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197467 by Joffm
Replied by Joffm on topic Multiple choice with two comments boxes
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.
  • startx25
  • startx25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #197486 by startx25
Replied by startx25 on topic Multiple choice with two comments boxes
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.

Lime-years ahead

Online-surveys for every purse and purpose