Welcome to the LimeSurvey Community Forum

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

Customized table with token and questions

9 months 4 weeks ago #230997 by CarlottaToletti
I was wondering if it's possible to change the following script to create the same type of question we were talking above but with one difference: the last one column should be a checkbox instead of a menu dropdown (obviously we should have just one option with the checkbox instead of three like in the menu dropdown).

There is the script I'm using now:

<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');

// Insert selects
$('.answer-item.answer_cell_X005', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">increase</option>\
<option value="2">stay the same</option>\
<option value="3">decrease</option>\

// Listeners
$('.inserted-select', thisQuestion).on('change', function(i) {
if($(this).val() != '') {
$(this).closest('.answer-item').find('input:text').val($('option:selected', this).val()).trigger('change');
else {

// Returning to page
$('.with-select input:text', thisQuestion).each(function(i) {
var thisCell = $(this).closest('.answer-item');
var inputText = $.trim($(this).val());
$('select.inserted-select', thisCell).val(inputText);
// Clean-up styles
$('select.inserted-select', thisQuestion).css({
'max-width': '100%'
$('.with-select input:text', thisQuestion).css({
'position': 'absolute',
'left': '-9999em'

// Set the first two columns to readonly
$('.answer-item:nth-child(2) input:text', thisQuestion).prop('readonly', true);
$('.answer-item:nth-child(3) input:text', thisQuestion).prop('readonly', true);


Thanks in advance


Please Log in to join the conversation.

9 months 4 weeks ago #231015 by Joffm
Hi, Carlotta
here you find something to insert checkboxes into your array(text)
[url] forums.limesurvey.org/forum/can-i-do-thi...ith-radiolist#226020 [/url]


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

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose