Welcome to the LimeSurvey Community Forum

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

Help in design printanswers

  • djarnold
  • djarnold's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago - 7 years 4 months ago #144401 by djarnold
Help in design printanswers was created by djarnold
Hello!

I'm generating my own printanswers code but I need to hide the div of multiple choice on the options that aren't selected





here is the code I use to do this


Code:
<div class="pGroup">
      <h3>II. Group Title</h3>
      <div class="pPreg">
        <div class="pRow">
          <div class="pName">Select Option</div>
        </div>
        <div class="pRow">
            <div class="pAns">{if(p3_SQ001 == "Y", p3_SQ001.shown, "")}</div>
        </div>
                <div class="pRow">
            <div class="pAns">{if(p3_SQ002 == "Y", p3_SQ002.shown, "")}</div>
        </div>
 
                <div class="pRow">
          <div class="pAns">{if(p3_SQ003 == "Y", p3_SQ003.shown, "")}</div>
        </div>
                <div class="pRow">
        <div class="pAns">{if(p3_SQ004 == "Y", p3_SQ004.shown, "")}></div>
    </div>
</div>


is there any way to hide the empty row?
Last edit: 7 years 4 months ago by djarnold.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144404 by DenisChenu
Replied by DenisChenu on topic Help in design printanswers
Hi,

manual.limesurvey.org/Expression_Manager#XSS_security

If you are super admin, you can use
Code:
{if(p3_SQ004 == "Y",'<div class="pRow"><div class="pAns">'+p3_SQ004.shown+'</div></div>', "")}

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.
  • djarnold
  • djarnold's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago - 7 years 4 months ago #144412 by djarnold
Replied by djarnold on topic Help in design printanswers
Thak you! I will try these method


I solved myself using this method
Add an ID to every row you want to hide
Code:
<div id="r1" class="pRow">
and a following js script for every id
Code:
<script type="text/javascript">
        if("{p3_SQ001}" != "Y")
        {
            document.getElementById('r1').style.display = 'none';
        }
</script>

fortunately my survey is very small
Last edit: 7 years 4 months ago by djarnold.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose