Welcome to the LimeSurvey Community Forum

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

Question validation equation

  • MikeConom
  • MikeConom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 11 months ago #106531 by MikeConom
Question validation equation was created by MikeConom
is it possible to check the year in the Question validation equation ?

i am trying with this but return error
Code:
(if(! is_empty(xrn1_2_1_3.NAOK), 
xrn1_2_1_3.NAOK >= "1970" &amp;&amp; xrn1_2_1_3.NAOK <= {(new Date).getFullYear()}, xrn1_2_1_3.NAOK == ""))
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 11 months ago - 9 years 11 months ago #106550 by tpartner
Replied by tpartner on topic Question validation equation
Mike, could you please elaborate? What question type(s), etc? What exactly are you trying to do?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 11 months ago by tpartner.
The topic has been locked.
  • MikeConom
  • MikeConom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 11 months ago #106552 by MikeConom
Replied by MikeConom on topic Question validation equation
Tony
The question type is array numbers and i am trying to check the current year in one field.
i have found a solution, i made a hidden question and i have apply the year in the field, so
i use the senario
Code:
(if(! is_empty(xrn1_2_1_3.NAOK), 
xrn1_2_1_3.NAOK >= "1970" &amp;&amp; xrn1_2_1_3.NAOK <= CurrentYear.NAOK, xrn1_2_1_3.NAOK == ""))

i dont know if there is a better senario to check the year inside the validation
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose