Is there possible to validate to DOB

Hi,
Is there possible to calculate to validate DOB, i mean want to allow user enter data DOB Age 16 years up, if user enter DOB age below 16 years will error popup.

best regards,
Sophearom

@sophearom, maybe you could do it as outlined in the image shared below:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo: when the age is <16 years

Data entry screen as seen in Enketo: when the age is >16 years

Reference xlsform:

Date constraint.xlsx (23.2 KB)

Dear Kal_Lam,
I have format DOB as text (type) because we want user to type in dd-mm-yyyy, it seems syntax provided not work. kindly have advise?


Best Regards,
Sophearom

Try using the date question type and that should solve your issue.

we don’t use date data type for field DOB, I mean we’re using DOB field text type to allow user enter quicker than using (date data type). I wondering if we use DOB field as text data type maybe have other solution can be done?

best regards,
sophearom

Hi Kal,
Sorry to bother you again. With above code, I am not able to get the desired result. My DOB should give me range of age only between 17 to 70 years. I have used the following code but of no use.
Requesting your inputs on this.

@Priyanka, maybe this workaround should solve your issue:

In the survey tab of your XLSForm:

Data entry screen as seen in Enketo: when the DOB is less then 17 years

Data entry screen as seen in Enketo: when the DOB is in between 17-70 years

image

Data entry screen as seen in Enketo: when the DOB is greater then 70 years

image

Reference XLSForm:

Date constraint.xlsx (23.4 KB)