Try adding this script to Q22's footer:
<style>
#[% QuestionName() %] {
display: none;
}
</style>
<script>
$(document).ready(function(){
// Parameters
var q20 = [% Q20 %];
// Run
var resp = SSI_GetValue('[% QuestionName() %]');
var select = $('<select id="[% QuestionName() %]_select"></select>');
for (var i = 0; i <= q20; i++) {
var option = '<option value="' + i + '"';
if (i == resp) {
option += ' selected';
}
option += '>' + i + '</option>';
$(select).append($(option));
}
$('#[% QuestionName() %]').after($(select));
$(select).change(function(){
$('#[% QuestionName() %]').val($(this).val());
});
})
</script>
If Q20 is renamed, line 10 must be updated.