Welcome to the LimeSurvey Community Forum

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

Relevance Equation for Other option

  • Orbit-Reiter
  • Orbit-Reiter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
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.)

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 months 3 weeks ago #251803 by DenisChenu
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.

(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.)
I think it must be reported, it work directly in 3.X and before

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
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 months 3 weeks ago - 5 months 3 weeks ago #251804 by Joffm
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
  • .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
  • Orbit-Reiter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
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.

Lime-years ahead

Online-surveys for every purse and purpose