Okay, lets point out for other readers that you are using INSERTANS or Expression Manager to pipe the answer values from a multiple-short-text into the options of a drop-down and into the headers of an array.
Given that the drop-down and array questions are on following pages, we can use JavaScript to "filter" all empty drop-down options and array columns. Here are solutions for both question types.
Set up your survey to use JavaScript
.
Add this script to the source of the drop-down question:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// Identify the question
var q1ID = '{QID}';
// Remove all options that have no text
$('#question'+q1ID+' option').filter(function() {
return $(this).text() == '';
}).remove();
});
</script>
Add this script to the source of the array question:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Identify the question
var q1ID = '{QID}';
var q1ID = 17571;
var q1 = $('#question'+q1ID+'');
// Add some column-specific classes
$('table.subquestions-list tr', q1).each(function(i){
$('> *', this).each(function(i){
$(this).attr('data-column', 'col-'+i);
});
});
// Hide all columns with empty headers
$('table.subquestions-list thead th', q1).each(function(i){
if($(this).text() == '') {
$('table.subquestions-list [data-column="'+$(this).attr('data-column')+'"]', q1).hide();
}
});
});
</script>
Here is your test survey back with these scripts inserted: