Welcome to the LimeSurvey Community Forum

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

How to make some options cannot be chosen in a multiple choice Array (Numbers)?

  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago - 3 years 4 months ago #223154 by xueting
Please help us help you and fill where relevant:
Your LimeSurvey version:  3.27.24
Own server or LimeSurvey hosting: own
Theme: Can I make some of the options cannot be chosen in a multiple choice question - Array (Numbers)?

==================
Hi all,
In my case I'd like to let option 5 and option 6 cannot be selected in a certain situation, as the following picture shows. So I was wondering how to blind the boxes of those 2 options?
 
[img

I've read a relevant post ( forums.limesurvey.org/forum/can-i-do-thi...selection-box#219536 ), the thing is the qustion type of the example is Multiple choice, while in my case is Array (Numbers). I failed to do it by just copying the code in the example, and I think the reason might be there seems not possible to edit default answer values as what have been done in the example.
The lss.file of my case is attached.
I'm looking forward to your suggestion. Thanks.
 File Attachment:File Name:  limesurvey...7475.lss
File Size:26 KB
Best regards,
Xueting
 
Last edit: 3 years 4 months ago by xueting.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #223162 by Joffm
Hi,
please, always provide a working example.
In your lss export there was an array filter that referred a not existing question, and there were no x-axis subquestions (so no checkboxes were displayed)

Well, what means "in a certain situation"?

You can remove the checkboxes or disable them.
Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
    // Remove in row 1
    $('#question{QID} tr[id^="javatbd"]:eq(0) .checkbox-item:eq(4) *').remove();
    $('#question{QID} tr[id^="javatbd"]:eq(0) .checkbox-item:eq(5) *').remove();
    // Disable in row 1
    $('#question{QID} tr[id^="javatbd"]:eq(0) .checkbox-item:eq(2) *').prop('disabled', true);
  });
</script>

 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #223168 by xueting
Thank you Joffm for your promote reply.
Sorry for the mistake, the array filter is from my attempt of following the example, but it shouldn't be there really. But I don't understand about 'there were no x-axis subquestions, and seems the checkboxes were displayed as the following. 

In certain situation actually means in some questions (no equation needed), in other words, sometimes some options are removed.
Thanks again for your time.
Wishing you a merry Christmas and a happy new year!
Regards,
Xueting
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #223172 by Joffm

'there were no x-axis subquestions

When I imported your survey, removed the array filter
only this was displayed 



Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose