Welcome to the LimeSurvey Community Forum

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

End message, conditional syntax error

  • c.pizzu
  • c.pizzu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #222964 by c.pizzu
End message, conditional syntax error was created by c.pizzu
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.27.24
Own server or LimeSurvey hosting: 
Theme: fruity

==================
Hello,

I´m new to the forum and hope you can help me.
I´m using Limesurvey for assessing two different products. Respondents are supposed to answer to several questions, each associated to a score for each of the product.
When respondents submit the questionnaire, they should see an end message, stating which of the two product is best for them. Unfortunately, the conditional syntax doesn´t seem to work as I would like (I underlined in bold, below, the part that doesn´t work). What I´m trying to have is "if 'result' is greater than 0, then...", "if 'result' is less than 0, then..." and "if 'result' is equal to 0, then..." but the first two conditions don´t work. Any suggestion on what I´m doing wrong? Thank you very much!

<div style="display:{if(result&gt;0,'block', 'none')};">
<h2>XXX is the best choice for your project!</h2>

<p>XXX is a blablabla. Please contact ZZZ for further guidance.</p>
</div>

<div style="display:{if(result&lt;0,'block', 'none')};">
<h2>YYY is the best choice for your project!</h2>

<p>YYY is a blablabla. Please contact ZZZ for further guidance.</p>
</div>

<div style="display:{if(result==0,'block', 'none')};">
<h2>There doesn't seem to be a clear winner between the two tools</h2>

<p>Please contact ZZZ for further guidance.</p>
</div>



 
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #222968 by holch
Replied by holch on topic End message, conditional syntax error
Well, you can see that the ">" is substituted by the html entity, so Limesurvey does not recognize it.

Try using "gt" instead and see what happens:
Code:
{if(result gt 0, 'block', 'none')};

However, I am not sure if you can use expression manager like this. I am not sure if the HTML/CSS part isn't parsed before the Expression Manager part.

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: DenisChenu
The topic has been locked.
  • c.pizzu
  • c.pizzu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #222970 by c.pizzu
Replied by c.pizzu on topic End message, conditional syntax error
Dear Holch,
Thank you very much, it worked! I had already tried that before but without including a space before and after "gt".
Have a nice day/evening,
Chiara
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose