Check out the LimeSurvey source code on GitHub!

Question validation equation

More
2 years 9 months ago #106531 by MikeConom
is it possible to check the year in the Question validation equation ?

i am trying with this but return error
(if(! is_empty(xrn1_2_1_3.NAOK), 
xrn1_2_1_3.NAOK >= "1970" && xrn1_2_1_3.NAOK <= {(new Date).getFullYear()}, xrn1_2_1_3.NAOK == ""))

Please Log in to join the conversation.

More
2 years 9 months ago - 2 years 9 months ago #106550 by tpartner
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: 2 years 9 months ago by tpartner.

Please Log in to join the conversation.

More
2 years 9 months ago #106552 by MikeConom
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
(if(! is_empty(xrn1_2_1_3.NAOK), 
xrn1_2_1_3.NAOK >= "1970" && 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

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form