Welcome to the LimeSurvey Community Forum

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

Can I hide a particular subquestion or answer using Expression Manager

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #134921 by tpartner
Try this:

Code:
<script type="text/javascript" charset="utf-8">    
  $(document).ready(function() {
    $('#question{QID} label.answertext').each(function(i) {
      if($.trim($(this).text()) == '') {
        $(this).closest('.question-item').find('input[type="text"]').val('');
        $(this).closest('.question-item').hide();
      }
    });
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 1 month ago #145453 by raygain
Hi tpartner ,

I need to hide answer on the basis of previous question answer !
for ex :

Q1 Which of the following type of calls have you made in the last one month from your landline/ wireline connection?

1. Local calls

2. STD calls

3. ISD/ International calls

if user select option 1 and 2 then in Q 2 third option (R3- ISD/ International calls ) will be hide

Q2.Do you recall facing congestion while making the following calls?
1. YES 2. NO
R1 - Local calls
R2- STD calls
R3- ISD/ International calls

plz refer some url for script or share script !

Regards
Raygain
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #145457 by holch
Depending on which version of Limesurvey you use, this is common Expression Manager via the subquestion relevance.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose