Bitte helfen Sie uns, Ihnen zu helfen und füllen Sie folgende Felder aus:
Ihre LimeSurvey-Version: Version 5.4.0+220913
Eigener Server oder LimeSurvey-Cloud:
Genutzte Designvorlage:
==================
[Schreiben Sie hier Ihre Nachricht]
Guten Tag,
ich versuche leider ohne wenig Erfolg, dass ich mit JavaScript eine Dritte Spalte zu einer Dual Matrix-Umfrage hinzufüge. Es wird mir zwar eine Dritte Spalte angezeigt, aber ohne Inhalt: Ohne Textfeld. Zudem ist mir auch nicht klar, wie ich die Überschrift für die Spalte setzen kann.
Bräuchte ein paar Tipps, komme hier nicht weiter. Vorab schonmal danke.
Andreas
Hier mein Skript:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify the questions
var qArrayID = {QID};
var qArray = $('#question'+qArrayID);
var qMultiText = qArray.nextAll('.multiple-short-txt:eq(0)');
// Add some classes
qArray.addClass('array-with-uploads-question');
// Hide the multi-short-text question
$(qMultiText).hide();
$('table.questions-list col:not(.col-answers)', qArray).css('width', 'auto');
$('table.questions-list thead tr', qArray).append('<th class="answer-text inserted-column-label" /></th>');
$('tr.answers-list', qArray).each(function(i) {
$(this).append('<td class="answer-item text-item">\
</td>\
');
});
// Load the column label for the text inputs
$('.inserted-column-label:eq(0)', qArray).text($('.ls-label-question', qMultiText).text());
$('.text-item', qArray).prepend('<label class="ls-label-xs-visibility">'+$('.ls-label-question', qMultiText).text()+'</label>')
// Loop through the multi-short-text sub-questions
$('li.answer-item', qMultiText).each(function(i) {
// Move the text inputs into the array
$('input[type="text"]', this).appendTo($('tr.answers-list:eq('+i+') .text-item', qArray));
});
});
</script>