Question validation equation

More
3 years 3 months ago #106531 by MikeConom
MikeConom created the topic: Question validation equation
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
3 years 3 months ago - 3 years 3 months ago #106550 by tpartner
tpartner replied the 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: 3 years 3 months ago by tpartner.

Please Log in to join the conversation.

More
3 years 3 months ago #106552 by MikeConom
MikeConom replied the 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
(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.

Start now!

Just create your account and start using Limesurvey today.

Register now