- Posts: 26
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Multiple choice & exclusive options q
- DB1324
- Topic Author
- Offline
- Junior Member
Less
More
8 years 3 months ago #129928
by DB1324
Multiple choice & exclusive options q was created by DB1324
Hi,
I am designing a questionnaire which has a multiple choice question, with answers A, B, C, D, E, None of the above, and Other (the 'Other' field from question settings).
Using the exclusive options feature I can cause all the other options to grey out if a user selects 'None of the above', which is great, but ideally if someone picks this option I'd like them to be able to enter some text in 'Other' too.
So, is it possible to have an 'exclusive options' style grey out that affects all but TWO responses, the selected one and an 'other' option?
(A thousand apologies if the answer is obvious - I'm very new to LimeSurvey :blush: )
Thank you!
I am designing a questionnaire which has a multiple choice question, with answers A, B, C, D, E, None of the above, and Other (the 'Other' field from question settings).
Using the exclusive options feature I can cause all the other options to grey out if a user selects 'None of the above', which is great, but ideally if someone picks this option I'd like them to be able to enter some text in 'Other' too.
So, is it possible to have an 'exclusive options' style grey out that affects all but TWO responses, the selected one and an 'other' option?
(A thousand apologies if the answer is obvious - I'm very new to LimeSurvey :blush: )
Thank you!
Attachments:
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11658
- Thank you received: 2742
8 years 3 months ago #129932
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Multiple choice & exclusive options q
No, exclusive means exclusive. so just this one response is valid. Now you might be able to do something with a custom Javascript, but I am no expert on this.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: DB1324
The topic has been locked.
- DB1324
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #129933
by DB1324
Replied by DB1324 on topic Multiple choice & exclusive options q
Thank you for the prompt response. Unfortunately I am no expert in Javascript either - I was hoping I'd overlooked something simple.
The topic has been locked.
- mguerrero
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 1
8 years 3 months ago - 8 years 3 months ago #129940
by mguerrero
Replied by mguerrero on topic Multiple choice & exclusive options q
Hi,
I think with this example achieved it what you need.
You must remove the exclusive option
Cheers
I think with this example achieved it what you need.
You must remove the exclusive option
Code:
<script> $(document).ready(function() { var thisQuestion = $('#question{QID}'); $('ul.subquestions-list li', thisQuestion).addClass('normalOpt'); $('ul.subquestions-list li', thisQuestion).each(function(i) { $('.other-item').removeClass('normalOpt').addClass('exlusiveOpt'); $('.exlusiveOpt').prev().removeClass('normalOpt').addClass('exlusiveOpt2'); }); $('.exlusiveOpt2 input[type=checkbox]').change(function(event) { if($(this).is(':checked')) { $('.normalOpt input[type=checkbox]').prop('disabled', true); $('.normalOpt input[type=checkbox]').prop("checked", false); $('.normalOpt input[type=checkbox]').val(''); } else{ $('.normalOpt input[type=checkbox]').prop('disabled', false); } }); }); </script>
Cheers
Attachments:
Last edit: 8 years 3 months ago by mguerrero.
The following user(s) said Thank You: DB1324
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
8 years 3 months ago #129946
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Multiple choice & exclusive options q
No need javascript : use filter for each subquestion.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: DB1324
The topic has been locked.
- DB1324
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #129950
by DB1324
Replied by DB1324 on topic Multiple choice & exclusive options q
I don't suppose you would be so kind as to give me a hint on how to do that (I can see filters in advanced settings for the question, but not at level of subquestions...)?
Thank you!
Thank you!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
8 years 3 months ago #129959
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Multiple choice & exclusive options q
You need to be on 2.06 version, don't remind the exact build. It's when you edit the Sub question.
You can copy paste the "auto generated" equation done with array_filter (with question logic files) , and remove it after.
Denis
PS : we really need to do a clean manual part for this ....
You can copy paste the "auto generated" equation done with array_filter (with question logic files) , and remove it after.
Denis
PS : we really need to do a clean manual part for this ....
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Attachments:
The following user(s) said Thank You: DB1324
The topic has been locked.
- first
- Offline
- Elite Member
Less
More
- Posts: 227
- Thank you received: 36
8 years 3 weeks ago #133685
by first
Survey Designer and Programmer
Replied by first on topic Multiple choice & exclusive options q
I tried and this actually hide the desired sub-question .. not disable them like exclusive option do...
Survey Designer and Programmer
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
8 years 3 weeks ago #133687
by DenisChenu
Did you try to use deactivate here ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Multiple choice & exclusive options q
We have a manual : manual.limesurvey.org/Question_type_-_Mu...rray_filter_style.29OMdev wrote: I tried and this actually hide the desired sub-question .. not disable them like exclusive option do...
Did you try to use deactivate here ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- first
- Offline
- Elite Member
Less
More
- Posts: 227
- Thank you received: 36
8 years 3 weeks ago #133698
by first
Survey Designer and Programmer
Replied by first on topic Multiple choice & exclusive options q
Kool.. Just slipped from my mind...
Survey Designer and Programmer
The topic has been locked.