Welcome, Guest
Username: Password: Remember me

TOPIC: Question validation equation

Question validation equation 7 months 4 days ago #106531

  • MikeConom
  • MikeConom's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 1
  • Karma: 0
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 == ""))
The administrator has disabled public write access.

Question validation equation 7 months 3 days ago #106550

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 7 months 3 days ago by tpartner.
The administrator has disabled public write access.

Question validation equation 7 months 3 days ago #106552

  • MikeConom
  • MikeConom's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 1
  • Karma: 0
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.188 seconds
Donation Image