Welcome to the LimeSurvey Community Forum

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

Question validation tip problem

  • pvdemael
  • pvdemael's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 2 months ago #116245 by pvdemael
Question validation tip problem was created by pvdemael
Hi all,

I encounter a problem implementing question validation tips.
All my attempts to generate a good validation tip have failed so far.

I have 2 questions where inputs should match before continuing the questionnaire

* sportsFrequencyNow: numerical input
* sportsDifferenceNow: array with 1 subquestion SQ001 with choice from 1 to 5

The combination of sportsFrequencyNow=0 and chosing 5 for sportsDifferenceNow should show the validation tip.

This is the code I use in the question validation:
!((sportsFrequencyNow==0) and intval(sportsDifference_SQ001.code)==5)

This works perfectly. A string "test" in the question validation tip turns red when the validation is violated and turns green when fine.

But the following question validation tip fails:
{if ((sportsFrequencyNow==0) and intval(sportsDifference_SQ001.code)==5, 'Impossible combination','Fine')}

It will always show "Fine" whatever I choose. Only the color changes which means that the validation equition works but the code in the tip is not working.

Can anyone help me out?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose