Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Remove answer options in array

  • elseeising
  • elseeising's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #190836 by elseeising
Remove answer options in array was created by elseeising
I have an array question where for some subquestions I would like to have the answer option "Not applicable", but I don't want this answer to be available for all subquestions.

I use LimeSurvey version 3.19.2

I already tried to add the following in the custom.css (adapted from the code to remove a textbox from a multiple questions with comments), but it is not working.

#answer979374X39885X567571SQ001-A6 {display: none;}

What am I doing wrong?

Thanks a lot!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #190838 by tpartner
Replied by tpartner on topic Remove answer options in array
Hiding the radio input will still allow it to be selected via the keyboard. You would be better off removing it with JavaScript (and you will also want to remove the associated label).

Place something like this in the question source:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Remove the answer options
    $('#answer{SGQ}SQ001-A6, label[for="answer{SGQ}SQ001-A6"]').remove();
  });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...1-08.lss
File Size:19 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • elseeising
  • elseeising's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #190845 by elseeising
Replied by elseeising on topic Remove answer options in array
Yes, that did the trick; thank you so much!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose