- Posts: 11
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Relevance Equation for Other option
- Orbit-Reiter
- Topic Author
- Offline
- New Member
Less
More
5 months 3 weeks ago #251798
by Orbit-Reiter
Relevance Equation for Other option was created by Orbit-Reiter
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.3.2
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity
==================
Hello!
I'm trying to hide the "other"-option for participants using certain languages. Specifically, I have 4 languages for the survey, the default being German. I want to disable all open text fields for the other 3 languages. I manage to do this with all questions and subquestions via a relevance equation, but I can't specifiy a relevance equation for the default other field that is activated via the question options.
Is there a way to do this?
(Interestingly, using {LANG} doesn't work if I use it directly in the equations but working around it by creating a hidden free text question that loads {LANG} into it and then using that question works.)
Your LimeSurvey version: 6.3.2
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity
==================
Hello!
I'm trying to hide the "other"-option for participants using certain languages. Specifically, I have 4 languages for the survey, the default being German. I want to disable all open text fields for the other 3 languages. I manage to do this with all questions and subquestions via a relevance equation, but I can't specifiy a relevance equation for the default other field that is activated via the question options.
Is there a way to do this?
(Interestingly, using {LANG} doesn't work if I use it directly in the equations but working around it by creating a hidden free text question that loads {LANG} into it and then using that question works.)
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 months 3 weeks ago #251803
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 Relevance Equation for Other option
There are no clean solution here …
Alternate solution : add an "MyOther" option, if Q01_MyOther == "Y" : show a text quetsion type.
Alternate solution : add an "MyOther" option, if Q01_MyOther == "Y" : show a text quetsion type.
I think it must be reported, it work directly in 3.X and before(Interestingly, using {LANG} doesn't work if I use it directly in the equations but working around it by creating a hidden free text question that loads {LANG} into it and then using that question works.)
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.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
5 months 3 weeks ago - 5 months 3 weeks ago #251804
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Relevance Equation for Other option
Hi,
Always the first thing to do is to use the webdevelopment tool of your browser (F12) to find the affected classes.
Here you will see that for
list(radio) and multiple questions these are
Now you have different options to enter it into the source code of the affected languages (all except German)
Either as javascript
or as css
Joffm
Always the first thing to do is to use the webdevelopment tool of your browser (F12) to find the affected classes.
Here you will see that for
list(radio) and multiple questions these are
- .other-text-item
- .othertext-label-checkox-container (It's not my typo, it's really "checkox")
Now you have different options to enter it into the source code of the affected languages (all except German)
Either as javascript
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('.other-text-item').hide(); $('.othertext-label-checkox-container').hide(); }); </script>
or as css
Code:
<style type="text/css"> .other-text-item, .othertext-label-checkox-container { display:none; } </style>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 months 3 weeks ago by Joffm.
Please Log in to join the conversation.
- Orbit-Reiter
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
5 months 3 weeks ago - 5 months 3 weeks ago #251806
by Orbit-Reiter
Replied by Orbit-Reiter on topic Relevance Equation for Other option
This worked quite well if added to the specific questions. Thank you for the help!
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var lang = "{LANG}"; if(lang!='de') { $('.other-text-item').hide(); $('.othertext-label-checkox-container').hide(); } }); </script>
Last edit: 5 months 3 weeks ago by Orbit-Reiter.
Please Log in to join the conversation.