- Posts: 162
- Thank you received: 14
Ask the community, share ideas, and connect with other LimeSurvey users!
$(document).on('ready',function(){ $('.list-with-comment').each(function(i) { var naCode = 'NA'; var thisQuestion = $(this); var qID = thisQuestion.attr('id').replace(/question/, ''); var $naInput = $('input:radio[id$="X'+qID+naCode+'"]', thisQuestion); if($naInput.length > 0) { // Hide the textarea if(!$naInput.is(':checked')) { $('.answer-item.text-item', thisQuestion).hide(); } // Listener on the radios $('input:radio', thisQuestion).on('click', function(e) { if($(this).is($naInput)) { // Show the textarea $('.answer-item.text-item', thisQuestion).fadeIn(500); } else { // Hide the textarea $('.answer-item.text-item', thisQuestion).fadeOut(500, function(e) { $('.answer-item.text-item textarea', thisQuestion).val('').trigger('keyup'); }); } }); } }); });
It can be reported as a issue in my opinion.teracomp wrote: That's a great idea, but when I use Bootstrap Buttons, the "Label for 'Other:' option" is not used. In other words, I entered "Not Applicable" as the 'Other' label, but it only works with Radio Buttons, not Bootstrap Buttons.