Check out the LimeSurvey source code on GitHub!

Can I set conditions on a date field?

More
5 years 9 months ago #60813 by cycas
I'd like a question to appear if someone has filled in a date of birth field to indicate their child is less than four years old.

Can I do this with conditions (if so, how? Less than [date] doesn't seem to work? Or will I need to Javascript it? Any hints how to approach this gratefully received!

Please Log in to join the conversation.

More
5 years 9 months ago #60826 by tpartner
I think you'll need to use JavaScript.

If the questions are on the same page you could put a listener on the date question that compares the input date to todays date and then shows/hides/clears the subsequent question.

If the questions are on separate pages the listener could populate a hidden question that could then be used to control the subsequent question with conditions.

Either way the JS details would depend on your date format.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

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