Limit date range in functon of previous answers

More
2 years 11 months ago #113600 by limes4LN
limes4LN created the topic: Limit date range in functon of previous answers
Hi,

Can I set a limit of the date range in a date field according to previous answers. For example :

Question 1 : Are you an adult, teenager ou child ?
Question 2 : Your birthday please ? (if Q1=child, then possible answers for Q2 = 2014-01-01 < Q2 < 2004-01-01, if Q1=adult, then possible answers for Q2 = 1994-01-01 < Q2 < 1910-01-01; etc.)

Please Log in to join the conversation.

More
2 years 11 months ago #113605 by tpartner
tpartner replied the topic: Limit date range in functon of previous answers
I don't think you can use Expression Manager to set the minimum an maximum dates.

The simplest solution would probably be three separate "birthday" questions shown conditionally depending on the "age group" question.


.

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.

More
2 years 11 months ago #113606 by tpartner
tpartner replied the topic: Limit date range in functon of previous answers
Oh, wait, I stand corrected. You can use EM in those settings - manual.limesurvey.org/Question_type_-_Da...9_.28New_in_2.05_.29

So, maybe something like this for the minimum date setting:
if(q1 == 1, '2004-01-01', if(q1 == 2, '1994-01-01', '1910-01-01'))

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.

Start now!

Just create your account and start using Limesurvey today.

Register now