Hi,
I'm trying to use either the plugin/theme option here or the script.
However, I can't make either work (I'm new to Limesurvey).
I downloaded the theme (
github.com/tpartner/LimeSurvey-Multiple-Choice-Dropdown-6x
), but after adding it to my theme manager, I can't install it. I get an "version error" message (I'm using Limesurvey Cloud 6.15.24). Does this work with the cloud version, or do I need the desktop one?
Considering the script, I'm not sure where to input it. I tried the "script" tab in the older question editor (I could not find it in the new editor), but I can't seem to make it do anything.
I'm using a script you provided another user (
forums.limesurvey.org/forum/design-issue...le-as-answer-options
):
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');
// Add a question class
thisQuestion.addClass('custom-array');
// Column-specific classes
$('table.subquestion-list tr', thisQuestion).each(function(i) {
$('th, td', this).each(function(i) {
$(this).addClass('column-'+i);
});
});
// Insert selects
$('.answer-item.answer_cell_X001', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Option 1</option>\
<option value="2">Option 2</option>\
<option value="3">Option 3</option>\
</select>');
// 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 {
$(this).closest('.answer-item').find('input:text').val('').trigger('change');
}
});
// 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'
});
});
</script>
When using it in the script tab of my question, I see this error:
Any help would be much appreciated!